diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
commit | dc6b8e72fed2586239e3514819238c520636c9d9 (patch) | |
tree | 88b200df0a0b7fab9d6f147596173556f1ed9a13 /kommander/editor/qcompletionedit.cpp | |
parent | 6927d4436e54551917f600b706a8d6109e49de1c (diff) | |
download | tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/editor/qcompletionedit.cpp')
-rw-r--r-- | kommander/editor/qcompletionedit.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/kommander/editor/qcompletionedit.cpp b/kommander/editor/qcompletionedit.cpp index bd4b876a..4ba5e366 100644 --- a/kommander/editor/qcompletionedit.cpp +++ b/kommander/editor/qcompletionedit.cpp @@ -1,26 +1,26 @@ #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 ); } @@ -30,12 +30,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; } @@ -45,7 +45,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(); @@ -65,8 +65,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() ); @@ -81,18 +81,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 ) { @@ -121,10 +121,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 ); @@ -134,8 +134,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 || @@ -144,15 +144,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; @@ -160,9 +160,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 ); } @@ -179,7 +179,7 @@ bool QCompletionEdit::isCaseSensitive() const void QCompletionEdit::clear() { - QLineEdit::clear(); + TQLineEdit::clear(); compList.clear(); } #include "qcompletionedit.moc" |