void UIControllerSetting::tbButton_clicked() { QToolButton* tb = qobject_cast<QToolButton*>( sender() ); if ( !mTimer->isActive() ) { tb->setChecked( true ); mPadKey = mButtons[ tb ]; QString text1 = QtYabause::translate(QString("Awaiting input for")); QString text2 = QtYabause::translate(mNames[ mPadKey ]); QString text3 = QtYabause::translate(QString("Press Esc key to cancel")); mlInfos->setText( text1 + QString(": %1\n").arg(text2) + text3 ); setScanFlags(mScanMasks[mPadKey]); mCore->Flush(); curTb=tb; tb->setAttribute(Qt::WA_TransparentForMouseEvents); mTimer->start(); } else { tb->setChecked( tb == mButtons.key( mPadKey ) ); } }
QGraphicsProxyWidget *KGVisualItemGroup::createButton() { QGraphicsProxyWidget *w = new QGraphicsProxyWidget; QToolButton *bt = new QToolButton(); bt->setText("v/h"); bt->setAttribute(Qt::WA_TranslucentBackground, true); w->setWidget(bt); bt->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); connect(bt, SIGNAL(clicked()), this, SLOT(stickyStateChanged())); return w; }
QT_BEGIN_NAMESPACE static QToolButton *createToolButton(QWidget *parent, Qt::ArrowType at, const QString &name) { QToolButton *rc = new QToolButton(); rc->setAttribute(Qt::WA_NoChildEventsForParent, true); rc->setParent(parent); rc->setObjectName(name); rc->setArrowType(at); rc->setAutoRaise(true); rc->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); rc->setFixedSize(QSize(15, 15)); return rc; }