summaryrefslogtreecommitdiffstats
path: root/src/editor.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-09 19:45:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-09 19:45:27 +0000
commitf4f8ac034fa04404e2fcd5029ba050c537c07d7a (patch)
tree0daa81b0533ce203c33d5571dcb842257dba4cd0 /src/editor.cpp
parent4488b6112c4e22493ed88c68035b980a5b42228d (diff)
downloadabakus-f4f8ac034fa04404e2fcd5029ba050c537c07d7a.tar.gz
abakus-f4f8ac034fa04404e2fcd5029ba050c537c07d7a.zip
TQt4 port Abakus
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/abakus@1231045 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/editor.cpp')
-rw-r--r--src/editor.cpp260
1 files changed, 130 insertions, 130 deletions
diff --git a/src/editor.cpp b/src/editor.cpp
index 186294b..ec83878 100644
--- a/src/editor.cpp
+++ b/src/editor.cpp
@@ -25,23 +25,23 @@
#include "evaluator.h"
#include "result.h"
-#include <qapplication.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qlistbox.h>
-#include <qpainter.h>
-#include <qregexp.h>
-#include <qstringlist.h>
-#include <qstyle.h>
-#include <qsyntaxhighlighter.h>
-#include <qtimer.h>
-#include <qtooltip.h>
-#include <qmessagebox.h>
-#include <qvbox.h>
+#include <tqapplication.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
+#include <tqlistbox.h>
+#include <tqpainter.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
+#include <tqstyle.h>
+#include <tqsyntaxhighlighter.h>
+#include <tqtimer.h>
+#include <tqtooltip.h>
+#include <tqmessagebox.h>
+#include <tqvbox.h>
#include <netwm.h>
#include <fixx11h.h> // netwm.h includes X11 headers which conflict with qevent
-#include <qevent.h>
+#include <tqevent.h>
#include <kdebug.h>
@@ -50,26 +50,26 @@
// XXX: QT 4: Replace this with qBinaryFind().
using std::binary_search;
-class CalcResultLabel : public QLabel
+class CalcResultLabel : public TQLabel
{
public:
- CalcResultLabel(QWidget *parent, const char *name, int WFlags) :
- QLabel(parent, name, WFlags)
+ CalcResultLabel(TQWidget *tqparent, const char *name, int WFlags) :
+ TQLabel(tqparent, name, WFlags)
{
}
protected:
- virtual void mousePressEvent(QMouseEvent *)
+ virtual void mousePressEvent(TQMouseEvent *)
{
hide();
}
};
-class EditorHighlighter : public QSyntaxHighlighter
+class EditorHighlighter : public TQSyntaxHighlighter
{
public:
EditorHighlighter( Editor* );
- int highlightParagraph ( const QString & text, int );
+ int highlightParagraph ( const TQString & text, int );
private:
Editor* editor;
@@ -79,50 +79,50 @@ class Editor::Private
{
public:
Evaluator* eval;
- QStringList history;
+ TQStringList history;
int index;
bool autoCompleteEnabled;
EditorCompletion* completion;
- QTimer* completionTimer;
+ TQTimer* completionTimer;
bool autoCalcEnabled;
char format;
int decimalDigits;
- QTimer* autoCalcTimer;
- QLabel* autoCalcLabel;
+ TQTimer* autoCalcTimer;
+ TQLabel* autoCalcLabel;
bool syntaxHighlightEnabled;
EditorHighlighter* highlighter;
- QMap<ColorType,QColor> highlightColors;
- QTimer* matchingTimer;
+ TQMap<ColorType,TQColor> highlightColors;
+ TQTimer* matchingTimer;
};
class EditorCompletion::Private
{
public:
Editor* editor;
- QVBox *completionPopup;
- QListBox *completionListBox;
+ TQVBox *completionPopup;
+ TQListBox *completionListBox;
};
-class ChoiceItem: public QListBoxText
+class ChoiceItem: public TQListBoxText
{
public:
- ChoiceItem( QListBox*, const QString& );
+ ChoiceItem( TQListBox*, const TQString& );
void setMinNameWidth (int w) { minNameWidth = w; }
int nameWidth() const;
protected:
- void paint( QPainter* p );
+ void paint( TQPainter* p );
private:
- QString item;
- QString desc;
+ TQString item;
+ TQString desc;
int minNameWidth;
};
-ChoiceItem::ChoiceItem( QListBox* listBox, const QString& text ):
- QListBoxText( listBox, text ), minNameWidth(0)
+ChoiceItem::ChoiceItem( TQListBox* listBox, const TQString& text ):
+ TQListBoxText( listBox, text ), minNameWidth(0)
{
- QStringList list = QStringList::split( ':', text );
+ TQStringList list = TQStringList::split( ':', text );
if( list.count() ) item = list[0];
if( list.count()>1 ) desc = list[1];
}
@@ -133,48 +133,48 @@ int ChoiceItem::nameWidth() const
if(item.isEmpty())
return 0;
- QFontMetrics fm = listBox()->fontMetrics();
+ TQFontMetrics fm = listBox()->fontMetrics();
return fm.width( item );
}
-void ChoiceItem::paint( QPainter* painter )
+void ChoiceItem::paint( TQPainter* painter )
{
int itemHeight = height( listBox() );
- QFontMetrics fm = painter->fontMetrics();
+ TQFontMetrics fm = painter->fontMetrics();
int yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent();
painter->drawText( 3, yPos, item );
//int xPos = fm.width( item );
- int xPos = QMAX(fm.width(item), minNameWidth);
+ int xPos = TQMAX(fm.width(item), minNameWidth);
if( !isSelected() )
- painter->setPen( listBox()->palette().disabled().text().dark() );
+ painter->setPen( listBox()->tqpalette().disabled().text().dark() );
painter->drawText( 10 + xPos, yPos, desc );
}
EditorHighlighter::EditorHighlighter( Editor* e ):
- QSyntaxHighlighter( e )
+ TQSyntaxHighlighter( e )
{
editor = e;
}
-int EditorHighlighter::highlightParagraph ( const QString & text, int )
+int EditorHighlighter::highlightParagraph ( const TQString & text, int )
{
if( !editor->isSyntaxHighlightEnabled() )
{
- setFormat( 0, text.length(), editor->colorGroup().text() );
+ setFormat( 0, text.length(), editor->tqcolorGroup().text() );
return 0;
}
- QStringList fnames = FunctionManager::instance()->functionList(FunctionManager::All);
+ TQStringList fnames = FunctionManager::instance()->functionList(FunctionManager::All);
fnames.sort(); // Sort list so we can bin search it.
Tokens tokens = Evaluator::scan( text );
for( unsigned i = 0; i < tokens.count(); i++ )
{
Token& token = tokens[i];
- QString text = token.text().lower();
- QFont font = editor->font();
- QColor color = Qt::black;
+ TQString text = token.text().lower();
+ TQFont font = editor->font();
+ TQColor color = TQt::black;
switch( token.type() )
{
case Token::Number:
@@ -204,22 +204,22 @@ int EditorHighlighter::highlightParagraph ( const QString & text, int )
-Editor::Editor( QWidget* parent, const char* name ):
- QTextEdit( parent, name )
+Editor::Editor( TQWidget* tqparent, const char* name ):
+ TQTextEdit( tqparent, name )
{
d = new Private;
d->eval = 0;
d->index = 0;
d->autoCompleteEnabled = true;
d->completion = new EditorCompletion( this );
- d->completionTimer = new QTimer( this );
+ d->completionTimer = new TQTimer( this );
d->autoCalcEnabled = true;
d->syntaxHighlightEnabled = true;
d->highlighter = new EditorHighlighter( this );
- d->autoCalcTimer = new QTimer( this );
- d->matchingTimer = new QTimer( this );
+ d->autoCalcTimer = new TQTimer( this );
+ d->matchingTimer = new TQTimer( this );
- setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ tqsetSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed );
setWordWrap( NoWrap );
setHScrollBarMode( AlwaysOff );
setVScrollBarMode( AlwaysOff );
@@ -228,26 +228,26 @@ Editor::Editor( QWidget* parent, const char* name ):
setTabChangesFocus( true );
setLinkUnderline( false );
- connect( d->completion, SIGNAL( selectedCompletion( const QString& ) ),
- SLOT( autoComplete( const QString& ) ) );
- connect( this, SIGNAL( textChanged() ), SLOT( checkAutoComplete() ) );
- connect( d->completionTimer, SIGNAL( timeout() ), SLOT( triggerAutoComplete() ) );
+ connect( d->completion, TQT_SIGNAL( selectedCompletion( const TQString& ) ),
+ TQT_SLOT( autoComplete( const TQString& ) ) );
+ connect( this, TQT_SIGNAL( textChanged() ), TQT_SLOT( checkAutoComplete() ) );
+ connect( d->completionTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( triggerAutoComplete() ) );
- connect( this, SIGNAL( textChanged() ), SLOT( checkMatching() ) );
- connect( d->matchingTimer, SIGNAL( timeout() ), SLOT( doMatchingLeft() ) );
- connect( d->matchingTimer, SIGNAL( timeout() ), SLOT( doMatchingRight() ) );
- connect( this, SIGNAL( textChanged() ), SLOT( checkAutoCalc() ) );
- connect( d->autoCalcTimer, SIGNAL( timeout() ), SLOT( autoCalc() ) );
+ connect( this, TQT_SIGNAL( textChanged() ), TQT_SLOT( checkMatching() ) );
+ connect( d->matchingTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( doMatchingLeft() ) );
+ connect( d->matchingTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( doMatchingRight() ) );
+ connect( this, TQT_SIGNAL( textChanged() ), TQT_SLOT( checkAutoCalc() ) );
+ connect( d->autoCalcTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( autoCalc() ) );
d->autoCalcLabel = new CalcResultLabel( 0, "autocalc", WStyle_StaysOnTop |
WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM );
- d->autoCalcLabel->setFrameStyle( QFrame::Plain | QFrame::Box );
- d->autoCalcLabel->setPalette( QToolTip::palette() );
+ d->autoCalcLabel->setFrameStyle( TQFrame::Plain | TQFrame::Box );
+ d->autoCalcLabel->setPalette( TQToolTip::palette() );
d->autoCalcLabel->hide();
- setHighlightColor( Number, QColor(0,0,127) );
- setHighlightColor( FunctionName, QColor(85,0,0) );
- setHighlightColor( Variable, QColor(0,85,0) );
- setHighlightColor( MatchedPar, QColor(255,255,183) );
+ setHighlightColor( Number, TQColor(0,0,127) );
+ setHighlightColor( FunctionName, TQColor(85,0,0) );
+ setHighlightColor( Variable, TQColor(0,85,0) );
+ setHighlightColor( MatchedPar, TQColor(255,255,183) );
}
Editor::~Editor()
@@ -256,24 +256,24 @@ Editor::~Editor()
delete d;
}
-QSize Editor::sizeHint() const
+TQSize Editor::tqsizeHint() const
{
constPolish();
- QFontMetrics fm = fontMetrics();
- int h = QMAX(fm.lineSpacing(), 14);
+ TQFontMetrics fm = fontMetrics();
+ int h = TQMAX(fm.lineSpacing(), 14);
int w = fm.width( 'x' ) * 20;
int m = frameWidth() * 2;
- return( style().sizeFromContents(QStyle::CT_LineEdit, this,
- QSize( w + m, h + m + 4 ).
- expandedTo(QApplication::globalStrut())));
+ return( tqstyle().tqsizeFromContents(TQStyle::CT_LineEdit, this,
+ TQSize( w + m, h + m + 4 ).
+ expandedTo(TQApplication::globalStrut())));
}
-QStringList Editor::history() const
+TQStringList Editor::history() const
{
return d->history;
}
-void Editor::setHistory( const QStringList& h )
+void Editor::setHistory( const TQStringList& h )
{
d->history = h;
d->index = d->history.count();
@@ -309,11 +309,11 @@ void Editor::setDecimalDigits( int digits )
d->decimalDigits = digits;
}
-void Editor::appendHistory( const QString& text )
+void Editor::appendHistory( const TQString& text )
{
if( text.isEmpty() ) return;
- QString lastText;
+ TQString lastText;
if( d->history.count() )
lastText = d->history[ d->history.count()-1 ];
if( text == lastText ) return;
@@ -333,9 +333,9 @@ void Editor::squelchNextAutoCalc()
d->autoCalcTimer->stop();
}
-void Editor::setText(const QString &txt)
+void Editor::setText(const TQString &txt)
{
- QTextEdit::setText(txt);
+ TQTextEdit::setText(txt);
squelchNextAutoCalc();
}
@@ -374,7 +374,7 @@ void Editor::doMatchingLeft()
getCursorPosition( &para, &curPos );
// check for right par
- QString subtext = text().left( curPos );
+ TQString subtext = text().left( curPos );
Tokens tokens = Evaluator::scan( subtext );
if( !tokens.valid() ) return;
if( tokens.count()<1 ) return;
@@ -423,7 +423,7 @@ void Editor::doMatchingRight()
getCursorPosition( &para, &curPos );
// check for left par
- QString subtext = text().right( text().length() - curPos );
+ TQString subtext = text().right( text().length() - curPos );
Tokens tokens = Evaluator::scan( subtext );
if( !tokens.valid() ) return;
if( tokens.count()<1 ) return;
@@ -472,7 +472,7 @@ void Editor::triggerAutoComplete()
// faster now that it uses flex. ;)
int para = 0, curPos = 0;
getCursorPosition( &para, &curPos );
- QString subtext = text().left( curPos );
+ TQString subtext = text().left( curPos );
Tokens tokens = Evaluator::scan( subtext );
if(!tokens.valid())
{
@@ -489,18 +489,18 @@ void Editor::triggerAutoComplete()
if( !lastToken.isIdentifier() )
return;
- QString id = lastToken.text();
+ TQString id = lastToken.text();
if( id.isEmpty() )
return;
// find matches in function names
- QStringList fnames = FunctionManager::instance()->functionList(FunctionManager::All);
- QStringList choices;
+ TQStringList fnames = FunctionManager::instance()->functionList(FunctionManager::All);
+ TQStringList choices;
for( unsigned i=0; i<fnames.count(); i++ )
- if( fnames[i].startsWith( id, false ) )
+ if( fnames[i].tqstartsWith( id, false ) )
{
- QString str = fnames[i];
+ TQString str = fnames[i];
::Function* f = FunctionManager::instance()->function( str );
if( f && !f->description.isEmpty() )
@@ -512,17 +512,17 @@ void Editor::triggerAutoComplete()
choices.sort();
// find matches in variables names
- QStringList vchoices;
- QStringList values = ValueManager::instance()->valueNames();
+ TQStringList vchoices;
+ TQStringList values = ValueManager::instance()->valueNames();
- for(QStringList::ConstIterator it = values.begin(); it != values.end(); ++it)
- if( (*it).startsWith( id, false ) )
+ for(TQStringList::ConstIterator it = values.begin(); it != values.end(); ++it)
+ if( (*it).tqstartsWith( id, false ) )
{
- QString choice = ValueManager::description(*it);
+ TQString choice = ValueManager::description(*it);
if(choice.isEmpty())
choice = ValueManager::instance()->value(*it).toString();
- vchoices.append( QString("%1:%2").arg( *it, choice ) );
+ vchoices.append( TQString("%1:%2").tqarg( *it, choice ) );
}
vchoices.sort();
@@ -534,7 +534,7 @@ void Editor::triggerAutoComplete()
// one match, complete it for the user
if( choices.count()==1 )
{
- QString str = QStringList::split( ':', choices[0] )[0];
+ TQString str = TQStringList::split( ':', choices[0] )[0];
// single perfect match, no need to give choices.
if(str == id.lower())
@@ -554,7 +554,7 @@ void Editor::triggerAutoComplete()
d->completion->showCompletion( choices );
}
-void Editor::autoComplete( const QString& item )
+void Editor::autoComplete( const TQString& item )
{
if( !d->autoCompleteEnabled || item.isEmpty() )
return;
@@ -562,7 +562,7 @@ void Editor::autoComplete( const QString& item )
int para = 0, curPos = 0;
getCursorPosition( &para, &curPos );
- QString subtext = text().left( curPos );
+ TQString subtext = text().left( curPos );
Tokens tokens = Evaluator::scan( subtext );
if( !tokens.valid() || tokens.count() < 1 )
@@ -572,7 +572,7 @@ void Editor::autoComplete( const QString& item )
if( !lastToken.isIdentifier() )
return;
- QStringList str = QStringList::split( ':', item );
+ TQStringList str = TQStringList::split( ':', item );
blockSignals( true );
setSelection( 0, lastToken.pos(), 0, lastToken.pos()+lastToken.text().length() );
@@ -585,7 +585,7 @@ void Editor::autoCalc()
if( !d->autoCalcEnabled )
return;
- QString str = Evaluator::autoFix( text() );
+ TQString str = Evaluator::autoFix( text() );
if( str.isEmpty() )
return;
@@ -595,8 +595,8 @@ void Editor::autoCalc()
return;
// If we're using set for a function don't try.
- QRegExp setFn("\\s*set.*\\(.*=");
- if( str.find(setFn) != -1 )
+ TQRegExp setFn("\\s*set.*\\(.*=");
+ if( str.tqfind(setFn) != -1 )
return;
// strip off assignment operator, e.g. "x=1+2" becomes "1+2" only
@@ -622,19 +622,19 @@ void Editor::autoCalc()
Abakus::number_t result = parseString(str.latin1());
if( Result::lastResult()->type() == Result::Value )
{
- QString ss = QString("Result: <b>%2</b>").arg(result.toString());
+ TQString ss = TQString("Result: <b>%2</b>").tqarg(result.toString());
d->autoCalcLabel->setText( ss );
d->autoCalcLabel->adjustSize();
// reposition nicely
- QPoint pos = mapToGlobal( QPoint( 0, 0 ) );
+ TQPoint pos = mapToGlobal( TQPoint( 0, 0 ) );
pos.setY( pos.y() - d->autoCalcLabel->height() - 1 );
d->autoCalcLabel->move( pos );
d->autoCalcLabel->show();
d->autoCalcLabel->raise();
// do not show it forever
- QTimer::singleShot( 5000, d->autoCalcLabel, SLOT( hide()) );
+ TQTimer::singleShot( 5000, d->autoCalcLabel, TQT_SLOT( hide()) );
}
else
{
@@ -643,7 +643,7 @@ void Editor::autoCalc()
}
}
-QString Editor::formatNumber( const Abakus::number_t &value ) const
+TQString Editor::formatNumber( const Abakus::number_t &value ) const
{
return value.toString();
}
@@ -678,7 +678,7 @@ void Editor::historyForward()
ensureCursorVisible();
}
-void Editor::keyPressEvent( QKeyEvent* e )
+void Editor::keyPressEvent( TQKeyEvent* e )
{
if( e->key() == Key_Up )
{
@@ -708,10 +708,10 @@ void Editor::keyPressEvent( QKeyEvent* e )
checkMatching();
}
- QTextEdit::keyPressEvent( e );
+ TQTextEdit::keyPressEvent( e );
}
-void Editor::wheelEvent( QWheelEvent *e )
+void Editor::wheelEvent( TQWheelEvent *e )
{
if( e->delta() > 0 )
historyBack();
@@ -732,7 +732,7 @@ bool Editor::isSyntaxHighlightEnabled() const
return d->syntaxHighlightEnabled;
}
-void Editor::setHighlightColor( ColorType type, QColor color )
+void Editor::setHighlightColor( ColorType type, TQColor color )
{
d->highlightColors[ type ] = color;
@@ -742,26 +742,26 @@ void Editor::setHighlightColor( ColorType type, QColor color )
d->highlighter->rehighlight();
}
-QColor Editor::highlightColor( ColorType type )
+TQColor Editor::highlightColor( ColorType type )
{
return d->highlightColors[ type ];
}
-EditorCompletion::EditorCompletion( Editor* editor ): QObject( editor )
+EditorCompletion::EditorCompletion( Editor* editor ): TQObject( editor )
{
d = new Private;
d->editor = editor;
- d->completionPopup = new QVBox( editor->topLevelWidget(), 0, WType_Popup );
- d->completionPopup->setFrameStyle( QFrame::Box | QFrame::Plain );
+ d->completionPopup = new TQVBox( editor->tqtopLevelWidget(), 0, WType_Popup );
+ d->completionPopup->setFrameStyle( TQFrame::Box | TQFrame::Plain );
d->completionPopup->setLineWidth( 1 );
d->completionPopup->installEventFilter( this );
- d->completionPopup->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum);
+ d->completionPopup->tqsetSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Minimum);
- d->completionListBox = new QListBox( d->completionPopup );
+ d->completionListBox = new TQListBox( d->completionPopup );
d->completionPopup->setFocusProxy( d->completionListBox );
- d->completionListBox->setFrameStyle( QFrame::NoFrame );
+ d->completionListBox->setFrameStyle( TQFrame::NoFrame );
d->completionListBox->setVariableWidth( true );
d->completionListBox->installEventFilter( this );
}
@@ -771,14 +771,14 @@ EditorCompletion::~EditorCompletion()
delete d;
}
-bool EditorCompletion::eventFilter( QObject *obj, QEvent *ev )
+bool EditorCompletion::eventFilter( TQObject *obj, TQEvent *ev )
{
- if ( obj == d->completionPopup || obj == d->completionListBox )
+ if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(d->completionPopup) || TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(d->completionListBox) )
{
- if ( ev->type() == QEvent::KeyPress )
+ if ( ev->type() == TQEvent::KeyPress )
{
- QKeyEvent *ke = (QKeyEvent*)ev;
+ TQKeyEvent *ke = (TQKeyEvent*)ev;
if ( ke->key() == Key_Enter || ke->key() == Key_Return )
{
doneCompletion();
@@ -792,11 +792,11 @@ bool EditorCompletion::eventFilter( QObject *obj, QEvent *ev )
d->completionPopup->close();
d->editor->setFocus();
- QApplication::sendEvent( d->editor, ev );
+ TQApplication::sendEvent( d->editor, ev );
return true;
}
- if ( ev->type() == QEvent::MouseButtonDblClick )
+ if ( ev->type() == TQEvent::MouseButtonDblClick )
{
doneCompletion();
return true;
@@ -814,7 +814,7 @@ void EditorCompletion::doneCompletion()
emit selectedCompletion( d->completionListBox->currentText() );
}
-void EditorCompletion::showCompletion( const QStringList &choices )
+void EditorCompletion::showCompletion( const TQStringList &choices )
{
static bool shown = false;
if( !choices.count() ) return;
@@ -838,14 +838,14 @@ void EditorCompletion::showCompletion( const QStringList &choices )
// size of the pop-up
d->completionPopup->setMaximumHeight( 120 );
- d->completionPopup->resize( d->completionListBox->sizeHint() +
- QSize( d->completionListBox->verticalScrollBar()->width() + 4,
+ d->completionPopup->resize( d->completionListBox->tqsizeHint() +
+ TQSize( d->completionListBox->verticalScrollBar()->width() + 4,
d->completionListBox->horizontalScrollBar()->height() + 4 ) );
if(!shown)
{
d->completionPopup->show();
- QTimer::singleShot ( 0, this, SLOT(moveCompletionPopup()) );
+ TQTimer::singleShot ( 0, this, TQT_SLOT(moveCompletionPopup()) );
}
else
{
@@ -860,14 +860,14 @@ void EditorCompletion::moveCompletionPopup()
int w = d->completionListBox->width();
// position, reference is editor's cursor position in global coord
- QFontMetrics fm( d->editor->font() );
+ TQFontMetrics fm( d->editor->font() );
int para = 0, curPos = 0;
d->editor->getCursorPosition( &para, &curPos );
int pixelsOffset = fm.width( d->editor->text(), curPos );
pixelsOffset -= d->editor->contentsX();
- QPoint pos = d->editor->mapToGlobal( QPoint( pixelsOffset, d->editor->height() ) );
+ TQPoint pos = d->editor->mapToGlobal( TQPoint( pixelsOffset, d->editor->height() ) );
// if popup is partially invisible, move to other position
NETRootInfo info(d->completionPopup->x11Display(),
@@ -876,7 +876,7 @@ void EditorCompletion::moveCompletionPopup()
info.activate(); // wtf is this needed for?
NETRect NETarea = info.workArea(info.currentDesktop());
- QRect area(NETarea.pos.x, NETarea.pos.y, NETarea.size.width, NETarea.size.height);
+ TQRect area(NETarea.pos.x, NETarea.pos.y, NETarea.size.width, NETarea.size.height);
if( pos.y() + h > area.y() + area.height() )
pos.setY( pos.y() - h - d->editor->height() );