X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fpenwidget.cpp;h=4bd966af36e2af3cf3ac4e1f8c1d7a893f768f33;hb=bf5a50feb0f84a4627a65c5b82c3ca2d2eefe54b;hp=2a557e39d150f54ab48e080eace9d234d0425aee;hpb=c20f82651fdc4dd26172bcb71a85e6eb29eacd43;p=architektonas diff --git a/src/penwidget.cpp b/src/penwidget.cpp index 2a557e3..4bd966a 100644 --- a/src/penwidget.cpp +++ b/src/penwidget.cpp @@ -29,6 +29,14 @@ PenWidget::PenWidget(void): QWidget(), r(0), g(0), b(0), programChange(false) QLabel * l1 = new QLabel(tr("Width:")); QLabel * l2 = new QLabel(tr("RGB:")); QLabel * l3 = new QLabel(tr("Style:")); + QToolButton * qtb = new QToolButton(this); + + QAction * action = new QAction(QIcon(":/res/pen-stamp.png"), tr(""), this); + action->setToolTip(tr("Stamp Selected")); + action->setStatusTip(tr("Stamp selected objects with pen attributes.")); + action->setShortcut(QKeySequence(tr("p,p"))); +// action->setCheckable(checkable); + qtb->setDefaultAction(action); style->insertItem(1, tr("Solid")); style->insertItem(2, tr("Dash")); @@ -63,6 +71,7 @@ PenWidget::PenWidget(void): QWidget(), r(0), g(0), b(0), programChange(false) hbox1->addWidget(blue, 0, Qt::AlignLeft); hbox1->addWidget(l3, 0, Qt::AlignLeft); hbox1->addWidget(style, 0, Qt::AlignLeft); + hbox1->addWidget(qtb, 0, Qt::AlignLeft); hbox1->addStretch(1); setLayout(hbox1); @@ -72,6 +81,7 @@ PenWidget::PenWidget(void): QWidget(), r(0), g(0), b(0), programChange(false) connect(green, SIGNAL(textEdited(QString)), this, SLOT(HandleGreenSelected(QString))); connect(blue, SIGNAL(textEdited(QString)), this, SLOT(HandleBlueSelected(QString))); connect(style, SIGNAL(currentIndexChanged(int)), this, SLOT(HandleStyleSelected(int))); + connect(qtb, SIGNAL(triggered(QAction *)), this, SLOT(HandleStamp(QAction *))); } @@ -175,3 +185,9 @@ void PenWidget::HandleBlueSelected(QString text) emit ColorSelected(Global::penColor); } + +void PenWidget::HandleStamp(QAction * /* action */) +{ + emit StampSelected(); +} +