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.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/kdevdesigner/designer/qcompletionedit.cpp b/kdevdesigner/designer/qcompletionedit.cpp
index 9c735577..c00e9b84 100644
--- a/kdevdesigner/designer/qcompletionedit.cpp
+++ b/kdevdesigner/designer/qcompletionedit.cpp
@@ -25,28 +25,28 @@
**********************************************************************/
#include "qcompletionedit.h"
-#include <qlistbox.h>
-#include <qsizegrip.h>
-#include <qapplication.h>
-#include <qvbox.h>
+#include <tqlistbox.h>
+#include <tqsizegrip.h>
+#include <tqapplication.h>
+#include <tqvbox.h>
-QCompletionEdit::QCompletionEdit( QWidget *parent, const char *name )
- : QLineEdit( parent, name ), aAdd( FALSE ), caseSensitive( FALSE )
+QCompletionEdit::QCompletionEdit( TQWidget *parent, const char *name )
+ : TQLineEdit( parent, name ), aAdd( FALSE ), caseSensitive( FALSE )
{
- popup = new QVBox( 0, 0, WType_Popup );
- popup->setFrameStyle( QFrame::Box | QFrame::Plain );
+ popup = new TQVBox( 0, 0, WType_Popup );
+ popup->setFrameStyle( TQFrame::Box | TQFrame::Plain );
popup->setLineWidth( 1 );
popup->hide();
- listbox = new QListBox( popup );
- listbox->setFrameStyle( QFrame::NoFrame );
+ listbox = new TQListBox( popup );
+ listbox->setFrameStyle( TQFrame::NoFrame );
listbox->setLineWidth( 1 );
listbox->installEventFilter( this );
- listbox->setHScrollBarMode( QScrollView::AlwaysOn );
- listbox->setVScrollBarMode( QScrollView::AlwaysOn );
- listbox->setCornerWidget( new QSizeGrip( listbox, "completion sizegrip" ) );
- connect( this, SIGNAL( textChanged( const QString & ) ),
- this, SLOT( textDidChange( const QString & ) ) );
+ 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 & ) ) );
popup->setFocusProxy( listbox );
installEventFilter( this );
}
@@ -56,12 +56,12 @@ bool QCompletionEdit::autoAdd() const
return aAdd;
}
-QStringList QCompletionEdit::completionList() const
+TQStringList QCompletionEdit::completionList() const
{
return compList;
}
-void QCompletionEdit::setCompletionList( const QStringList &l )
+void QCompletionEdit::setCompletionList( const TQStringList &l )
{
compList = l;
}
@@ -71,7 +71,7 @@ void QCompletionEdit::setAutoAdd( bool add )
aAdd = add;
}
-void QCompletionEdit::textDidChange( const QString &text )
+void QCompletionEdit::textDidChange( const TQString &text )
{
if ( text.isEmpty() ) {
popup->close();
@@ -91,8 +91,8 @@ void QCompletionEdit::placeListBox()
popup->resize( QMAX( listbox->sizeHint().width() + listbox->verticalScrollBar()->width() + 4, width() ),
listbox->sizeHint().height() + listbox->horizontalScrollBar()->height() + 4 );
- QPoint p( mapToGlobal( QPoint( 0, 0 ) ) );
- if ( p.y() + height() + popup->height() <= QApplication::desktop()->height() )
+ TQPoint p( mapToGlobal( TQPoint( 0, 0 ) ) );
+ if ( p.y() + height() + popup->height() <= TQApplication::desktop()->height() )
popup->move( p.x(), p.y() + height() );
else
popup->move( p.x(), p.y() - listbox->height() );
@@ -107,18 +107,18 @@ void QCompletionEdit::updateListBox()
listbox->clear();
if ( compList.isEmpty() )
return;
- for ( QStringList::Iterator it = compList.begin(); it != compList.end(); ++it ) {
+ for ( TQStringList::Iterator it = compList.begin(); it != compList.end(); ++it ) {
if ( caseSensitive && (*it).left( text().length() ) == text() ||
!caseSensitive && (*it).left( text().length() ).lower() == text().lower() )
listbox->insertItem( *it );
}
}
-bool QCompletionEdit::eventFilter( QObject *o, QEvent *e )
+bool QCompletionEdit::eventFilter( TQObject *o, TQEvent *e )
{
if ( o == popup || o == listbox || o == listbox->viewport() ) {
- if ( e->type() == QEvent::KeyPress ) {
- QKeyEvent *ke = (QKeyEvent*)e;
+ 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 ) {
@@ -147,10 +147,10 @@ bool QCompletionEdit::eventFilter( QObject *o, QEvent *e )
popup->close();
setFocus();
}
- QApplication::sendEvent( this, e );
+ TQApplication::sendEvent( this, e );
return TRUE;
}
- } else if ( e->type() == QEvent::MouseButtonDblClick ) {
+ } else if ( e->type() == TQEvent::MouseButtonDblClick ) {
popup->close();
setFocus();
blockSignals( TRUE );
@@ -160,8 +160,8 @@ bool QCompletionEdit::eventFilter( QObject *o, QEvent *e )
return TRUE;
}
} else if ( o == this ) {
- if ( e->type() == QEvent::KeyPress ) {
- QKeyEvent *ke = (QKeyEvent*)e;
+ if ( e->type() == TQEvent::KeyPress ) {
+ TQKeyEvent *ke = (TQKeyEvent*)e;
if ( ke->key() == Key_Up ||
ke->key() == Key_Down ||
ke->key() == Key_Prior ||
@@ -170,15 +170,15 @@ bool QCompletionEdit::eventFilter( QObject *o, QEvent *e )
ke->key() == Key_Enter ||
ke->key() == Key_Tab ||
ke->key() == Key_Escape ) {
- QApplication::sendEvent( listbox, e );
+ TQApplication::sendEvent( listbox, e );
return TRUE;
}
}
}
- return QLineEdit::eventFilter( o, e );
+ return TQLineEdit::eventFilter( o, e );
}
-void QCompletionEdit::addCompletionEntry( const QString &entry )
+void QCompletionEdit::addCompletionEntry( const TQString &entry )
{
if ( compList.find( entry ) == compList.end() ) {
compList << entry;
@@ -186,9 +186,9 @@ void QCompletionEdit::addCompletionEntry( const QString &entry )
}
}
-void QCompletionEdit::removeCompletionEntry( const QString &entry )
+void QCompletionEdit::removeCompletionEntry( const TQString &entry )
{
- QStringList::Iterator it = compList.find( entry );
+ TQStringList::Iterator it = compList.find( entry );
if ( it != compList.end() )
compList.remove( it );
}
@@ -205,6 +205,6 @@ bool QCompletionEdit::isCaseSensitive() const
void QCompletionEdit::clear()
{
- QLineEdit::clear();
+ TQLineEdit::clear();
compList.clear();
}