summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/qcompletionedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/qcompletionedit.cpp')
-rw-r--r--kdevdesigner/designer/qcompletionedit.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/kdevdesigner/designer/qcompletionedit.cpp b/kdevdesigner/designer/qcompletionedit.cpp
index ed0c986e..25ba5f47 100644
--- a/kdevdesigner/designer/qcompletionedit.cpp
+++ b/kdevdesigner/designer/qcompletionedit.cpp
@@ -31,7 +31,7 @@
#include <tqvbox.h>
QCompletionEdit::QCompletionEdit( TQWidget *parent, const char *name )
- : TQLineEdit( parent, name ), aAdd( FALSE ), caseSensitive( FALSE )
+ : TQLineEdit( parent, name ), aAdd( false ), caseSensitive( false )
{
popup = new TQVBox( 0, 0, WType_Popup );
popup->setFrameStyle( TQFrame::Box | TQFrame::Plain );
@@ -45,8 +45,8 @@ QCompletionEdit::QCompletionEdit( TQWidget *parent, const char *name )
listbox->setHScrollBarMode( TQScrollView::AlwaysOn );
listbox->setVScrollBarMode( TQScrollView::AlwaysOn );
listbox->setCornerWidget( new TQSizeGrip( listbox, "completion sizegrip" ) );
- connect( this, TQT_SIGNAL( textChanged( const TQString & ) ),
- this, TQT_SLOT( textDidChange( const TQString & ) ) );
+ connect( this, TQ_SIGNAL( textChanged( const TQString & ) ),
+ this, TQ_SLOT( textDidChange( const TQString & ) ) );
popup->setFocusProxy( listbox );
installEventFilter( this );
}
@@ -98,7 +98,7 @@ void QCompletionEdit::placeListBox()
popup->move( p.x(), p.y() - listbox->height() );
popup->show();
listbox->setCurrentItem( 0 );
- listbox->setSelected( 0, TRUE );
+ listbox->setSelected( 0, true );
setFocus();
}
@@ -116,27 +116,27 @@ void QCompletionEdit::updateListBox()
bool QCompletionEdit::eventFilter( TQObject *o, TQEvent *e )
{
- if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(popup) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(listbox) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(listbox->viewport()) ) {
+ if ( o == popup || o == listbox || o == listbox->viewport() ) {
if ( e->type() == TQEvent::KeyPress ) {
TQKeyEvent *ke = (TQKeyEvent*)e;
if ( ke->key() == Key_Enter || ke->key() == Key_Return || ke->key() == Key_Tab ) {
if ( ke->key() == Key_Tab && listbox->count() > 1 &&
listbox->currentItem() < (int)listbox->count() - 1 ) {
listbox->setCurrentItem( listbox->currentItem() + 1 );
- return TRUE;
+ return true;
}
popup->close();
setFocus();
- blockSignals( TRUE );
+ blockSignals( true );
setText( listbox->currentText() );
- blockSignals( FALSE );
+ blockSignals( false );
emit chosen( text() );
- return TRUE;
+ return true;
} else if ( ke->key() == Key_Left || ke->key() == Key_Right ||
ke->key() == Key_Up || ke->key() == Key_Down ||
ke->key() == Key_Home || ke->key() == Key_End ||
ke->key() == Key_Prior || ke->key() == Key_Next ) {
- return FALSE;
+ return false;
} else if ( ke->key() == Key_Escape ) {
popup->close();
setFocus();
@@ -148,18 +148,18 @@ bool QCompletionEdit::eventFilter( TQObject *o, TQEvent *e )
setFocus();
}
TQApplication::sendEvent( this, e );
- return TRUE;
+ return true;
}
} else if ( e->type() == TQEvent::MouseButtonDblClick ) {
popup->close();
setFocus();
- blockSignals( TRUE );
+ blockSignals( true );
setText( listbox->currentText() );
- blockSignals( FALSE );
+ blockSignals( false );
emit chosen( text() );
- return TRUE;
+ return true;
}
- } else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) ) {
+ } else if ( o == this ) {
if ( e->type() == TQEvent::KeyPress ) {
TQKeyEvent *ke = (TQKeyEvent*)e;
if ( ke->key() == Key_Up ||
@@ -171,7 +171,7 @@ bool QCompletionEdit::eventFilter( TQObject *o, TQEvent *e )
ke->key() == Key_Tab ||
ke->key() == Key_Escape ) {
TQApplication::sendEvent( listbox, e );
- return TRUE;
+ return true;
}
}
}