diff options
Diffstat (limited to 'kbarcode/dstextedit.cpp')
-rw-r--r-- | kbarcode/dstextedit.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/kbarcode/dstextedit.cpp b/kbarcode/dstextedit.cpp index e059e96..370d88c 100644 --- a/kbarcode/dstextedit.cpp +++ b/kbarcode/dstextedit.cpp @@ -17,36 +17,36 @@ #include "dstextedit.h" #include "dstextedit.moc" -#include <qregexp.h> +#include <tqregexp.h> -DSTextEdit::DSTextEdit( QWidget* parent, const char* name ) - : TextEditBase( parent, name ) +DSTextEdit::DSTextEdit( TQWidget* tqparent, const char* name ) + : TextEditBase( tqparent, name ) { - connect( this, SIGNAL( textChanged() ), this, SLOT( fixParagraphs() ) ); + connect( this, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( fixParagraphs() ) ); } void DSTextEdit::fixParagraphs() { struct { - QFont font; - QColor color; - int alignment; + TQFont font; + TQColor color; + int tqalignment; } tFormattings; - QString t; + TQString t; int pos = 0; int count = 0; int i; int para, index; // needed to save the cursor position int paraFrom, indexFrom, paraTo, indexTo; // needed to save the selection - QValueList<int> chars; - QRegExp reg("<p[^>]*>"); + TQValueList<int> chars; + TQRegExp reg("<p[^>]*>"); for( i = 0; i < paragraphs(); i++ ) chars.append( paragraphLength( i ) ); // disconnect us first as we change the text here - disconnect( this, SIGNAL( textChanged() ), this, SLOT( fixParagraphs() ) ); + disconnect( this, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( fixParagraphs() ) ); getCursorPosition( ¶, &index ); getSelection( ¶From, &indexFrom, ¶To, &indexTo ); @@ -57,7 +57,7 @@ void DSTextEdit::fixParagraphs() t = this->text(); tFormattings.font = this->currentFont(); tFormattings.color = this->color(); - tFormattings.alignment = this->alignment(); + tFormattings.tqalignment = this->tqalignment(); while( pos != -1 ) { @@ -85,13 +85,13 @@ void DSTextEdit::fixParagraphs() while( pos != -1 ) { - pos = t.findRev( "</p>", pos ); + pos = t.tqfindRev( "</p>", pos ); if( pos != -1 ) { ++count; if( count > 1 ) //&& pos != -1 ) - t = t.replace( pos, 4, "<br />" ); + t = t.tqreplace( pos, 4, "<br />" ); else pos -= 4; } @@ -101,11 +101,11 @@ void DSTextEdit::fixParagraphs() this->setCursorPosition( 0, index ); this->setCurrentFont( tFormattings.font ); this->setColor( tFormattings.color ); - this->setAlignment( tFormattings.alignment ); + this->tqsetAlignment( tFormattings.tqalignment ); this->setSelection( paraFrom, indexFrom, paraTo, indexTo ); - connect( this, SIGNAL( textChanged() ), this, SLOT( fixParagraphs() ) ); + connect( this, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( fixParagraphs() ) ); } /* @@ -120,7 +120,7 @@ bool DSTextEdit::cursorIsInToken() { int para, index; int firstopen, firstclose; - QString data; + TQString data; getCursorPosition( ¶, &index ); @@ -128,14 +128,14 @@ bool DSTextEdit::cursorIsInToken() qDebug("data=" + data ); --index; - firstopen = data.findRev( "[", index ); - firstclose = data.findRev( "]", index ); + firstopen = data.tqfindRev( "[", index ); + firstclose = data.tqfindRev( "]", index ); ++index; if( firstopen != -1 && firstopen > firstclose ) { - firstopen = data.find( "[", index ); - firstclose = data.find( "]", index ); + firstopen = data.tqfind( "[", index ); + firstclose = data.tqfind( "]", index ); if( ( firstclose != -1 && firstopen != -1 && firstclose < firstopen ) || ( firstclose != -1 && firstopen == -1 ) ) return true; |