diff options
Diffstat (limited to 'krecipes/src/widgets/kretextedit.cpp')
-rw-r--r-- | krecipes/src/widgets/kretextedit.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/krecipes/src/widgets/kretextedit.cpp b/krecipes/src/widgets/kretextedit.cpp index 55565d2..84c1a94 100644 --- a/krecipes/src/widgets/kretextedit.cpp +++ b/krecipes/src/widgets/kretextedit.cpp @@ -10,12 +10,12 @@ #include "kretextedit.h" -#include <qtextstream.h> +#include <ntqtextstream.h> #include <kaccel.h> #include <kdebug.h> -KreTextEdit::KreTextEdit( QWidget *parent ) : KTextEdit( parent ), KCompletionBase() +KreTextEdit::KreTextEdit( TQWidget *parent ) : KTextEdit( parent ), KCompletionBase() { KCompletion * comp = completionObject(); //creates the completion object comp->setIgnoreCase( true ); @@ -30,7 +30,7 @@ void KreTextEdit::haltCompletion() completing = false; } -void KreTextEdit::keyPressEvent( QKeyEvent *e ) +void KreTextEdit::keyPressEvent( TQKeyEvent *e ) { // Filter key-events if completion mode is not set to CompletionNone KKey key( e ); @@ -40,9 +40,9 @@ void KreTextEdit::keyPressEvent( QKeyEvent *e ) bool noModifier = ( e->state() == NoButton || e->state() == ShiftButton ); if ( noModifier ) { - QString keycode = e->text(); + TQString keycode = e->text(); if ( !keycode.isEmpty() && keycode.unicode() ->isPrint() ) { - QTextEdit::keyPressEvent ( e ); + TQTextEdit::keyPressEvent ( e ); tryCompletion(); e->accept(); return ; @@ -56,7 +56,7 @@ void KreTextEdit::keyPressEvent( QKeyEvent *e ) cut = keys[ TextCompletion ]; //using just the standard Ctrl+E isn't user-friendly enough for Grandma... - if ( completing && ( cut.contains( key ) || e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return ) ) { + if ( completing && ( cut.contains( key ) || e->key() == TQt::Key_Enter || e->key() == TQt::Key_Return ) ) { int paraFrom, indexFrom, paraTo, indexTo; getSelection ( ¶From, &indexFrom, ¶To, &indexTo ); @@ -93,10 +93,10 @@ void KreTextEdit::keyPressEvent( QKeyEvent *e ) //any other key events will end any text completion execpt for modifiers switch ( e->key() ) { - case Qt::Key_Shift: - case Qt::Key_Control: - case Qt::Key_Alt: - case Qt::Key_Meta: + case TQt::Key_Shift: + case TQt::Key_Control: + case TQt::Key_Alt: + case TQt::Key_Meta: break; default: completing = false; @@ -107,12 +107,12 @@ void KreTextEdit::keyPressEvent( QKeyEvent *e ) KTextEdit::keyPressEvent ( e ); } -void KreTextEdit::setCompletedText( const QString &txt ) +void KreTextEdit::setCompletedText( const TQString &txt ) { int para, index; getCursorPosition( ¶, &index ); - QString para_text = text( para ); + TQString para_text = text( para ); int word_length = index - completion_begin; insert( txt.right( txt.length() - word_length ) ); @@ -122,7 +122,7 @@ void KreTextEdit::setCompletedText( const QString &txt ) completing = true; } -void KreTextEdit::setCompletedItems( const QStringList &/*items*/ ) +void KreTextEdit::setCompletedItems( const TQStringList &/*items*/ ) {} void KreTextEdit::tryCompletion() @@ -130,14 +130,14 @@ void KreTextEdit::tryCompletion() int para, index; getCursorPosition( ¶, &index ); - QString para_text = text( para ); + TQString para_text = text( para ); if ( para_text.at( index ).isSpace() || completing ) { if ( !completing ) completion_begin = para_text.findRev( ' ', index - 1 ) + 1; - QString completing_word = para_text.mid( completion_begin, index - completion_begin ); + TQString completing_word = para_text.mid( completion_begin, index - completion_begin ); - QString match = compObj() ->makeCompletion( completing_word ); + TQString match = compObj() ->makeCompletion( completing_word ); if ( !match.isNull() && match != completing_word ) setCompletedText( match ); @@ -152,25 +152,25 @@ void KreTextEdit::rotateText( KCompletionBase::KeyBindingType type ) if ( comp && completing && ( type == KCompletionBase::PrevCompletionMatch || type == KCompletionBase::NextCompletionMatch ) ) { - QString input = ( type == KCompletionBase::PrevCompletionMatch ) ? comp->previousMatch() : comp->nextMatch(); + TQString input = ( type == KCompletionBase::PrevCompletionMatch ) ? comp->previousMatch() : comp->nextMatch(); // Skip rotation if previous/next match is null or the same text int para, index; getCursorPosition( ¶, &index ); - QString para_text = text( para ); - QString complete_word = para_text.mid( completion_begin, index - completion_begin ); + TQString para_text = text( para ); + TQString complete_word = para_text.mid( completion_begin, index - completion_begin ); if ( input.isNull() || input == complete_word ) return ; setCompletedText( input ); } } -void KreTextEdit::addCompletionItem( const QString &name ) +void KreTextEdit::addCompletionItem( const TQString &name ) { compObj() ->addItem( name ); } -void KreTextEdit::removeCompletionItem( const QString &name ) +void KreTextEdit::removeCompletionItem( const TQString &name ) { compObj() ->removeItem( name ); } |