diff options
Diffstat (limited to 'tdeui/klineedit.cpp')
-rw-r--r-- | tdeui/klineedit.cpp | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/tdeui/klineedit.cpp b/tdeui/klineedit.cpp index 92afc91fd..c1fc7d8f0 100644 --- a/tdeui/klineedit.cpp +++ b/tdeui/klineedit.cpp @@ -136,13 +136,13 @@ void KLineEdit::init() d->autoSuggest = (mode == TDEGlobalSettings::CompletionMan || mode == TDEGlobalSettings::CompletionPopupAuto || mode == TDEGlobalSettings::CompletionAuto); - connect( this, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotRestoreSelectionColors())); + connect( this, TQ_SIGNAL(selectionChanged()), this, TQ_SLOT(slotRestoreSelectionColors())); TQPalette p = palette(); if ( !d->previousHighlightedTextColor.isValid() ) - d->previousHighlightedTextColor=p.color(TQPalette::Normal,TQColorGroup::HighlightedText); + d->previousHighlightedTextColor=p.color(TQPalette::Active,TQColorGroup::HighlightedText); if ( !d->previousHighlightColor.isValid() ) - d->previousHighlightColor=p.color(TQPalette::Normal,TQColorGroup::Highlight); + d->previousHighlightColor=p.color(TQPalette::Active,TQColorGroup::Highlight); d->drawClickMsg = false; } @@ -420,10 +420,10 @@ bool KLineEdit::copySqueezedText(bool clipboard) const return false; TQString t = d->squeezedText; t = t.mid(start, end - start); - disconnect( TQApplication::clipboard(), TQT_SIGNAL(selectionChanged()), this, 0); + disconnect( TQApplication::clipboard(), TQ_SIGNAL(selectionChanged()), this, 0); TQApplication::clipboard()->setText( t, clipboard ? TQClipboard::Clipboard : TQClipboard::Selection ); - connect( TQApplication::clipboard(), TQT_SIGNAL(selectionChanged()), this, - TQT_SLOT(clipboardChanged()) ); + connect( TQApplication::clipboard(), TQ_SIGNAL(selectionChanged()), this, + TQ_SLOT(clipboardChanged()) ); return true; } return false; @@ -526,7 +526,7 @@ void KLineEdit::keyPressEvent( TQKeyEvent *e ) { KeyBindingMap keys = getKeyBindings(); TDEGlobalSettings::Completion mode = completionMode(); - bool noModifier = (e->state() == Qt::NoButton || + bool noModifier = (e->state() == TQt::NoButton || e->state() == TQt::ShiftButton || e->state() == TQt::Keypad); @@ -536,7 +536,7 @@ void KLineEdit::keyPressEvent( TQKeyEvent *e ) { if ( !d->userSelection && hasSelectedText() && ( e->key() == Key_Right || e->key() == Key_Left ) && - e->state()== Qt::NoButton ) + e->state()== TQt::NoButton ) { TQString old_txt = text(); d->disableRestoreSelection = true; @@ -817,18 +817,18 @@ void KLineEdit::keyPressEvent( TQKeyEvent *e ) void KLineEdit::mouseDoubleClickEvent( TQMouseEvent* e ) { - if ( e->button() == Qt::LeftButton ) + if ( e->button() == TQt::LeftButton ) { possibleTripleClick=true; TQTimer::singleShot( TQApplication::doubleClickInterval(),this, - TQT_SLOT(tripleClickTimeout()) ); + TQ_SLOT(tripleClickTimeout()) ); } TQLineEdit::mouseDoubleClickEvent( e ); } void KLineEdit::mousePressEvent( TQMouseEvent* e ) { - if ( possibleTripleClick && e->button() == Qt::LeftButton ) + if ( possibleTripleClick && e->button() == TQt::LeftButton ) { selectAll(); e->accept(); @@ -841,7 +841,7 @@ void KLineEdit::mouseReleaseEvent( TQMouseEvent* e ) { TQLineEdit::mouseReleaseEvent( e ); if (TQApplication::clipboard()->supportsSelection() ) { - if ( e->button() == Qt::LeftButton ) { + if ( e->button() == TQt::LeftButton ) { // Fix copying of squeezed text if needed copySqueezedText( false ); } @@ -879,8 +879,8 @@ TQPopupMenu *KLineEdit::createPopupMenu() if ( compObj() && !isReadOnly() && kapp->authorize("lineedit_text_completion") ) { TQPopupMenu *subMenu = new TQPopupMenu( popup ); - connect( subMenu, TQT_SIGNAL( activated( int ) ), - this, TQT_SLOT( completionMenuActivated( int ) ) ); + connect( subMenu, TQ_SIGNAL( activated( int ) ), + this, TQ_SLOT( completionMenuActivated( int ) ) ); popup->insertSeparator(); popup->insertItem( SmallIconSet("completion"), i18n("Text Completion"), @@ -1006,12 +1006,12 @@ void KLineEdit::dropEvent(TQDropEvent *e) bool KLineEdit::eventFilter( TQObject* o, TQEvent* ev ) { - if( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) ) + if( o == this ) { - KCursor::autoHideEventFilter( TQT_TQOBJECT(this), ev ); + KCursor::autoHideEventFilter( this, ev ); if ( ev->type() == TQEvent::AccelOverride ) { - TQKeyEvent *e = TQT_TQKEYEVENT( ev ); + TQKeyEvent *e = static_cast<TQKeyEvent*>( ev ); if (overrideAccel (e)) { e->accept(); @@ -1020,14 +1020,14 @@ bool KLineEdit::eventFilter( TQObject* o, TQEvent* ev ) } else if( ev->type() == TQEvent::KeyPress ) { - TQKeyEvent *e = TQT_TQKEYEVENT( ev ); + TQKeyEvent *e = static_cast<TQKeyEvent*>( ev ); - if( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) + if( e->key() == TQt::Key_Return || e->key() == TQt::Key_Enter ) { bool trap = d->completionBox && d->completionBox->isVisible(); bool stopEvent = trap || (d->grabReturnKeyEvents && - (e->state() == Qt::NoButton || + (e->state() == TQt::NoButton || e->state() == TQt::Keypad)); // Qt will emit returnPressed() itself if we return false @@ -1088,14 +1088,12 @@ void KLineEdit::setCompletionBox( TDECompletionBox *box ) d->completionBox = box; if ( handleSignals() ) { - connect( d->completionBox, TQT_SIGNAL(highlighted( const TQString& )), - TQT_SLOT(setTextWorkaround( const TQString& )) ); - connect( d->completionBox, TQT_SIGNAL(userCancelled( const TQString& )), - TQT_SLOT(userCancelled( const TQString& )) ); - - // TODO: we need our own slot, and to call setModified(true) if Qt4 has that. - connect( d->completionBox, TQT_SIGNAL( activated( const TQString& )), - TQT_SIGNAL(completionBoxActivated( const TQString& )) ); + connect( d->completionBox, TQ_SIGNAL(highlighted( const TQString& )), + TQ_SLOT(setTextWorkaround( const TQString& )) ); + connect( d->completionBox, TQ_SIGNAL(userCancelled( const TQString& )), + TQ_SLOT(userCancelled( const TQString& )) ); + connect( d->completionBox, TQ_SIGNAL( activated( const TQString& )), + TQ_SIGNAL(completionBoxActivated( const TQString& )) ); } } @@ -1182,7 +1180,7 @@ bool KLineEdit::overrideAccel (const TQKeyEvent* e) int key = e->key(); ButtonState state = e->state(); if ((key == Key_Backtab || key == Key_Tab) && - (state == Qt::NoButton || (state & TQt::ShiftButton))) + (state == TQt::NoButton || (state & TQt::ShiftButton))) { return true; } @@ -1273,12 +1271,12 @@ void KLineEdit::setCompletionObject( TDECompletion* comp, bool hsig ) { TDECompletion *oldComp = compObj(); if ( oldComp && handleSignals() ) - disconnect( oldComp, TQT_SIGNAL( matches( const TQStringList& )), - this, TQT_SLOT( setCompletedItems( const TQStringList& ))); + disconnect( oldComp, TQ_SIGNAL( matches( const TQStringList& )), + this, TQ_SLOT( setCompletedItems( const TQStringList& ))); if ( comp && hsig ) - connect( comp, TQT_SIGNAL( matches( const TQStringList& )), - this, TQT_SLOT( setCompletedItems( const TQStringList& ))); + connect( comp, TQ_SIGNAL( matches( const TQStringList& )), + this, TQ_SLOT( setCompletedItems( const TQStringList& ))); TDECompletionBase::setCompletionObject( comp, hsig ); } |