void pLineEdit::init() { mMargin = sizeHint().height() -2; mSpacing = 0; tbSearch = new QToolButton( this ); tbSearch->setIcon( pIconManager::icon( "search.png", ":/fresh" ) ); tbSearch->setToolTip( tr( "Search Options" ) ); tbSearch->setStyleSheet( "QToolButton { border: none; padding: 0px; } QToolButton::menu-indicator { right: -2px; bottom: -2px; }" ); tbSearch->setCursor( Qt::ArrowCursor ); tbSearch->setFocusPolicy( Qt::NoFocus ); tbSearch->setPopupMode( QToolButton::InstantPopup ); tbClear = new QToolButton( this ); tbClear->setIcon( pIconManager::icon( "edit-clear-rtl.png", ":/fresh" ) ); tbClear->setToolTip( tr( "Clear" ) ); tbClear->setStyleSheet( "QToolButton { border: none; padding: 0px; }" ); tbClear->setCursor( Qt::ArrowCursor ); tbClear->setFocusPolicy( Qt::NoFocus ); setSearchButtonVisible( true ); setClearButtonVisible( false ); setPromptText( "Search..." ); mTimer = new QTimer( this ); mTimer->setInterval( mTimeOut ); mTimer->setSingleShot( true ); connect( this, SIGNAL( textChanged( const QString& ) ), this, SLOT( _q_textChanged( const QString& ) ) ); connect( tbSearch, SIGNAL( clicked() ), this, SIGNAL( searchButtonClicked() ) ); connect( tbSearch, SIGNAL( triggered( QAction* ) ), this, SIGNAL( searchButtonActionTriggered( QAction* ) ) ); connect( tbClear, SIGNAL( clicked() ), this, SLOT( clear() ) ); connect( tbClear, SIGNAL( clicked() ), this, SIGNAL( clearButtonClicked() ) ); connect( mTimer, SIGNAL( timeout() ), this, SLOT( timer_timeout() ) ); }
pKeySequenceEdit::pKeySequenceEdit( QWidget* parent ) : pLineEdit( parent ) { mFinished = true; setSearchButtonVisible( false ); setPromptText( tr( "Press a keybord shortcut..." ) ); }
void RestartLayer::showPrompt() { m_pHead->setVisible(false); if(!m_pPromptText) { CCString *promptText = getScene()->getPromptText(); setPromptText(CCLabelTTF::create(promptText->getCString(), "Arial", 25)); m_pPromptText->setDimensions(CCSizeMake(154, 170)); m_pPromptText->setPosition(ccp(150,150)); m_pPromptText->setColor(ccBLACK); m_pTV->addChild(m_pPromptText); } m_pPromptText->setVisible(true); }