diff options
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 262 |
1 files changed, 131 insertions, 131 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index cd7de9f..60e77bd 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -31,12 +31,12 @@ #include <kactionclasses.h> #include <kinputdialog.h> -#include <qlayout.h> -#include <qvbox.h> -#include <qhbox.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> -#include <qsplitter.h> +#include <tqlayout.h> +#include <tqvbox.h> +#include <tqhbox.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> +#include <tqsplitter.h> #include "editor.h" #include "evaluator.h" @@ -52,61 +52,61 @@ MainWindow::MainWindow() : KMainWindow(0, "abakus-mainwindow"), m_popup(0), m_insert(false) { - m_mainSplitter = new QSplitter(this); - QWidget *box = new QWidget(m_mainSplitter); - QVBoxLayout *layout = new QVBoxLayout(box); - m_layout = layout; - layout->setSpacing(6); - layout->setMargin(6); + m_mainSplitter = new TQSplitter(this); + TQWidget *box = new TQWidget(m_mainSplitter); + TQVBoxLayout *tqlayout = new TQVBoxLayout(box); + m_layout = tqlayout; + tqlayout->setSpacing(6); + tqlayout->setMargin(6); - QWidget *configBox = new QWidget(box); - layout->addWidget(configBox); + TQWidget *configBox = new TQWidget(box); + tqlayout->addWidget(configBox); - QHBoxLayout *configLayout = new QHBoxLayout(configBox); + TQHBoxLayout *configLayout = new TQHBoxLayout(configBox); - configLayout->addWidget(new QWidget(configBox)); + configLayout->addWidget(new TQWidget(configBox)); - QLabel *label = new QLabel(i18n("History: "), configBox); - label->setAlignment(AlignCenter); + TQLabel *label = new TQLabel(i18n("History: "), configBox); + label->tqsetAlignment(AlignCenter); configLayout->addWidget(label); - QButtonGroup *buttonGroup = new QButtonGroup(0); + TQButtonGroup *buttonGroup = new TQButtonGroup(0); - QWidget *buttonGroupBox = new QWidget(configBox); - QHBoxLayout *buttonGroupLayout = new QHBoxLayout(buttonGroupBox); + TQWidget *buttonGroupBox = new TQWidget(configBox); + TQHBoxLayout *buttonGroupLayout = new TQHBoxLayout(buttonGroupBox); buttonGroupLayout->addStretch(0); configLayout->addWidget(buttonGroupBox); - m_degrees = new QRadioButton(i18n("&Degrees"), buttonGroupBox); + m_degrees = new TQRadioButton(i18n("&Degrees"), buttonGroupBox); buttonGroup->insert(m_degrees); buttonGroupLayout->addWidget(m_degrees); slotDegrees(); - connect(m_degrees, SIGNAL(clicked()), SLOT(slotDegrees())); + connect(m_degrees, TQT_SIGNAL(clicked()), TQT_SLOT(slotDegrees())); - m_radians = new QRadioButton(i18n("&Radians"), buttonGroupBox); + m_radians = new TQRadioButton(i18n("&Radians"), buttonGroupBox); buttonGroup->insert(m_radians); buttonGroupLayout->addWidget(m_radians); - connect(m_radians, SIGNAL(clicked()), SLOT(slotRadians())); + connect(m_radians, TQT_SIGNAL(clicked()), TQT_SLOT(slotRadians())); - m_history = new QVBox(box); - layout->addWidget(m_history); + m_history = new TQVBox(box); + tqlayout->addWidget(m_history); m_history->setSpacing(6); m_history->setMargin(0); m_result = new ResultListView(m_history); - m_result->setSelectionMode(QListView::NoSelection); + m_result->setSelectionMode(TQListView::NoSelection); m_result->setHScrollBarMode(ResultListView::AlwaysOff); - connect(m_result, SIGNAL(signalEntrySelected(const QString &)), - SLOT(slotEntrySelected(const QString &))); - connect(m_result, SIGNAL(signalResultSelected(const QString &)), - SLOT(slotResultSelected(const QString &))); + connect(m_result, TQT_SIGNAL(signalEntrySelected(const TQString &)), + TQT_SLOT(slotEntrySelected(const TQString &))); + connect(m_result, TQT_SIGNAL(signalResultSelected(const TQString &)), + TQT_SLOT(slotResultSelected(const TQString &))); m_history->setStretchFactor(m_result, 1); - layout->setStretchFactor(m_history, 1); + tqlayout->setStretchFactor(m_history, 1); - QHBox *editBox = new QHBox(box); - layout->addWidget(editBox); + TQHBox *editBox = new TQHBox(box); + tqlayout->addWidget(editBox); editBox->setSpacing(6); m_edit = new Editor(editBox); @@ -115,12 +115,12 @@ MainWindow::MainWindow() : KMainWindow(0, "abakus-mainwindow"), m_popup(0), m_in KPushButton *evalButton = new KPushButton(i18n("&Evaluate"), editBox); - connect(evalButton, SIGNAL(clicked()), SLOT(slotEvaluate())); + connect(evalButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotEvaluate())); - connect(m_edit, SIGNAL(returnPressed()), SLOT(slotReturnPressed())); - connect(m_edit, SIGNAL(textChanged()), SLOT(slotTextChanged())); + connect(m_edit, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed())); + connect(m_edit, TQT_SIGNAL(textChanged()), TQT_SLOT(slotTextChanged())); - m_listSplitter = new QSplitter(Vertical, m_mainSplitter); + m_listSplitter = new TQSplitter(Qt::Vertical, m_mainSplitter); m_fnList = new FunctionListView(m_listSplitter); m_fnList->addColumn("Functions"); m_fnList->addColumn("Value"); @@ -129,24 +129,24 @@ MainWindow::MainWindow() : KMainWindow(0, "abakus-mainwindow"), m_popup(0), m_in m_varList->addColumn("Variables"); m_varList->addColumn("Value"); - connect(FunctionManager::instance(), SIGNAL(signalFunctionAdded(const QString &)), - this, SLOT(slotNewFunction(const QString &))); - connect(FunctionManager::instance(), SIGNAL(signalFunctionRemoved(const QString &)), - this, SLOT(slotRemoveFunction(const QString &))); + connect(FunctionManager::instance(), TQT_SIGNAL(signalFunctionAdded(const TQString &)), + this, TQT_SLOT(slotNewFunction(const TQString &))); + connect(FunctionManager::instance(), TQT_SIGNAL(signalFunctionRemoved(const TQString &)), + this, TQT_SLOT(slotRemoveFunction(const TQString &))); - connect(ValueManager::instance(), SIGNAL(signalValueAdded(const QString &, Abakus::number_t)), - this, SLOT(slotNewValue(const QString &, Abakus::number_t))); - connect(ValueManager::instance(), SIGNAL(signalValueChanged(const QString &, Abakus::number_t)), - this, SLOT(slotChangeValue(const QString &, Abakus::number_t))); - connect(ValueManager::instance(), SIGNAL(signalValueRemoved(const QString &)), - this, SLOT(slotRemoveValue(const QString &))); + connect(ValueManager::instance(), TQT_SIGNAL(signalValueAdded(const TQString &, Abakus::number_t)), + this, TQT_SLOT(slotNewValue(const TQString &, Abakus::number_t))); + connect(ValueManager::instance(), TQT_SIGNAL(signalValueChanged(const TQString &, Abakus::number_t)), + this, TQT_SLOT(slotChangeValue(const TQString &, Abakus::number_t))); + connect(ValueManager::instance(), TQT_SIGNAL(signalValueRemoved(const TQString &)), + this, TQT_SLOT(slotRemoveValue(const TQString &))); setupLayout(); setCentralWidget(m_mainSplitter); #if KDE_IS_VERSION(3,4,89) - setupGUI(QSize(450, 400), Keys | StatusBar | Save | Create); + setupGUI(TQSize(450, 400), Keys | StatusBar | Save | Create); #else setupGUI(Keys | StatusBar | Save | Create); #endif @@ -159,7 +159,7 @@ bool MainWindow::inRPNMode() const return action<KToggleAction>("toggleExpressionMode")->isChecked(); } -bool MainWindow::eventFilter(QObject *o, QEvent *e) +bool MainWindow::eventFilter(TQObject *o, TQEvent *e) { return KMainWindow::eventFilter(o, e); } @@ -170,7 +170,7 @@ bool MainWindow::queryExit() return KMainWindow::queryExit(); } -void MainWindow::contextMenuEvent(QContextMenuEvent *e) +void MainWindow::contextMenuEvent(TQContextMenuEvent *e) { static KPopupMenu *popup = 0; @@ -191,9 +191,9 @@ void MainWindow::polish() void MainWindow::slotReturnPressed() { - QString text = m_edit->text(); + TQString text = m_edit->text(); - text.replace("\n", ""); + text.tqreplace("\n", ""); m_edit->appendHistory(text); @@ -201,9 +201,9 @@ void MainWindow::slotReturnPressed() ResultListViewText *after = m_result->lastItem(); // Expand $foo references. - QString str = interpolateExpression(text, after); + TQString str = interpolateExpression(text, after); - QString resultVal; + TQString resultVal; ResultListViewText *item; if(str.isNull()) @@ -222,13 +222,13 @@ void MainWindow::slotReturnPressed() } else { m_insert = false; - resultVal = i18n("Error: %1").arg(RPNParser::errorString()); + resultVal = i18n("Error: %1").tqarg(RPNParser::errorString()); } // Skip creating list view items if in compact mode. if(!m_history->isShown()) { m_edit->setText(resultVal); - QTimer::singleShot(0, m_edit, SLOT(selectAll())); + TQTimer::singleShot(0, m_edit, TQT_SLOT(selectAll())); return; } @@ -241,7 +241,7 @@ void MainWindow::slotReturnPressed() if(FunctionManager::instance()->isFunction(str)) str += " ans"; - // Add right parentheses as needed to balance out the expression. + // Add right tqparentheses as needed to balance out the expression. int parenLevel = getParenthesesLevel(str); for(int i = 0; i < parenLevel; ++i) str += ')'; @@ -276,7 +276,7 @@ void MainWindow::slotReturnPressed() // Skip creating list view items if in compact mode. if(compact) { m_edit->setText(resultVal); - QTimer::singleShot(0, m_edit, SLOT(selectAll())); + TQTimer::singleShot(0, m_edit, TQT_SLOT(selectAll())); return; } @@ -287,12 +287,12 @@ void MainWindow::slotReturnPressed() m_result->setCurrentItem(item); m_result->ensureItemVisible(item); - QTimer::singleShot(0, m_edit, SLOT(selectAll())); + TQTimer::singleShot(0, m_edit, TQT_SLOT(selectAll())); } void MainWindow::slotTextChanged() { - QString str = m_edit->text(); + TQString str = m_edit->text(); if(str.length() == 1 && m_insert) { m_insert = false; @@ -301,9 +301,9 @@ void MainWindow::slotTextChanged() if(inRPNMode()) return; - if(str.find(QRegExp("^[-+*/^]")) != -1) { + if(str.tqfind(TQRegExp("^[-+*/^]")) != -1) { m_edit->setText("ans " + str + " "); - m_edit->moveCursor(QTextEdit::MoveEnd, false); + m_edit->moveCursor(TQTextEdit::MoveEnd, false); } } } @@ -315,10 +315,10 @@ void MainWindow::slotEvaluate() void MainWindow::slotUpdateSize() { - if(m_newSize != QSize(0, 0)) + if(m_newSize != TQSize(0, 0)) resize(m_newSize); else - resize(width(), minimumSize().height()); + resize(width(), tqminimumSize().height()); } void MainWindow::slotDegrees() @@ -337,7 +337,7 @@ void MainWindow::slotRadians() action<KToggleAction>("setRadiansMode")->setChecked(true); } -int MainWindow::getParenthesesLevel(const QString &str) +int MainWindow::getParenthesesLevel(const TQString &str) { int level = 0; @@ -355,7 +355,7 @@ void MainWindow::loadConfig() { KConfigGroup config(KGlobal::config(), "Settings"); - QString mode = config.readEntry("Trigonometric mode", "Degrees"); + TQString mode = config.readEntry("Trigonometric mode", "Degrees"); if(mode == "Degrees") { setTrigMode(Abakus::Degrees); m_degrees->setChecked(true); @@ -379,9 +379,9 @@ void MainWindow::loadConfig() { KConfigGroup config(KGlobal::config(), "Variables"); - QStringList list = config.readListEntry("Saved Variables"); - for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { - QStringList values = QStringList::split('=', *it); + TQStringList list = config.readListEntry("Saved Variables"); + for(TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { + TQStringList values = TQStringList::split('=', *it); if(values.count() != 2) { kdWarning() << "Your configuration file has somehow been corrupted!\n"; continue; @@ -411,14 +411,14 @@ void MainWindow::loadConfig() action<KToggleAction>("toggleCompactMode")->setChecked(compactMode); if(compactMode) - QTimer::singleShot(0, this, SLOT(slotToggleCompactMode())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotToggleCompactMode())); } { KConfigGroup config(KGlobal::config(), "Functions"); - QStringList fnList = config.readListEntry("FunctionList"); - for(QStringList::ConstIterator it = fnList.begin(); it != fnList.end(); ++it) + TQStringList fnList = config.readListEntry("FunctionList"); + for(TQStringList::ConstIterator it = fnList.begin(); it != fnList.end(); ++it) parseString(*it); // Run the function definitions through the parser } @@ -442,9 +442,9 @@ void MainWindow::saveConfig() { KConfigGroup config(KGlobal::config(), "Variables"); - QStringList list; - QStringList values = ValueManager::instance()->valueNames(); - QStringList::ConstIterator it = values.begin(); + TQStringList list; + TQStringList values = ValueManager::instance()->valueNames(); + TQStringList::ConstIterator it = values.begin(); // Set precision to max for most accuracy Abakus::m_prec = 75; @@ -453,9 +453,9 @@ void MainWindow::saveConfig() if(ValueManager::instance()->isValueReadOnly(*it)) continue; - list += QString("%1=%2") - .arg(*it) - .arg(ValueManager::instance()->value(*it).toString()); + list += TQString("%1=%2") + .tqarg(*it) + .tqarg(ValueManager::instance()->value(*it).toString()); } config.writeEntry("Saved Variables", list); @@ -484,15 +484,15 @@ void MainWindow::saveConfig() FunctionManager *manager = FunctionManager::instance(); - QStringList userFunctions = manager->functionList(FunctionManager::UserDefined); - QStringList saveList; + TQStringList userFunctions = manager->functionList(FunctionManager::UserDefined); + TQStringList saveList; - for(QStringList::ConstIterator it = userFunctions.begin(); it != userFunctions.end(); ++it) { + for(TQStringList::ConstIterator it = userFunctions.begin(); it != userFunctions.end(); ++it) { UnaryFunction *fn = dynamic_cast<UnaryFunction *>(manager->function(*it)->userFn->fn); - QString var = manager->function(*it)->userFn->varName; - QString expr = fn->operand()->infixString(); + TQString var = manager->function(*it)->userFn->varName; + TQString expr = fn->operand()->infixString(); - saveList += QString("set %1(%2) = %3").arg(*it).arg(var).arg(expr); + saveList += TQString("set %1(%2) = %3").tqarg(*it).tqarg(var).tqarg(expr); } config.writeEntry("FunctionList", saveList); @@ -503,65 +503,65 @@ void MainWindow::setupLayout() { KActionCollection *ac = actionCollection(); - KStdAction::quit(kapp, SLOT(quit()), ac); - KStdAction::showMenubar(this, SLOT(slotToggleMenuBar()), ac); + KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), ac); + KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(slotToggleMenuBar()), ac); - KToggleAction *ta = new KToggleAction(i18n("&Degrees"), SHIFT + ALT + Key_D, this, SLOT(slotDegrees()), ac, "setDegreesMode"); + KToggleAction *ta = new KToggleAction(i18n("&Degrees"), SHIFT + ALT + Key_D, TQT_TQOBJECT(this), TQT_SLOT(slotDegrees()), ac, "setDegreesMode"); ta->setExclusiveGroup("TrigMode"); ta->setChecked(trigMode() == Abakus::Degrees); - ta = new KToggleAction(i18n("&Radians"), SHIFT + ALT + Key_R, this, SLOT(slotRadians()), ac, "setRadiansMode"); + ta = new KToggleAction(i18n("&Radians"), SHIFT + ALT + Key_R, TQT_TQOBJECT(this), TQT_SLOT(slotRadians()), ac, "setRadiansMode"); ta->setExclusiveGroup("TrigMode"); ta->setChecked(trigMode() == Abakus::Radians); - ta = new KToggleAction(i18n("Show &History List"), SHIFT + ALT + Key_H, this, SLOT(slotToggleHistoryList()), ac, "toggleHistoryList"); + ta = new KToggleAction(i18n("Show &History List"), SHIFT + ALT + Key_H, TQT_TQOBJECT(this), TQT_SLOT(slotToggleHistoryList()), ac, "toggleHistoryList"); ta->setChecked(true); - ta = new KToggleAction(i18n("Show &Variables"), SHIFT + ALT + Key_V, this, SLOT(slotToggleVariableList()), ac, "toggleVariableList"); + ta = new KToggleAction(i18n("Show &Variables"), SHIFT + ALT + Key_V, TQT_TQOBJECT(this), TQT_SLOT(slotToggleVariableList()), ac, "toggleVariableList"); ta->setChecked(true); - ta = new KToggleAction(i18n("Show &Functions"), SHIFT + ALT + Key_F, this, SLOT(slotToggleFunctionList()), ac, "toggleFunctionList"); + ta = new KToggleAction(i18n("Show &Functions"), SHIFT + ALT + Key_F, TQT_TQOBJECT(this), TQT_SLOT(slotToggleFunctionList()), ac, "toggleFunctionList"); ta->setChecked(true); - ta = new KToggleAction(i18n("Activate &Compact Mode"), SHIFT + ALT + Key_C, this, SLOT(slotToggleCompactMode()), ac, "toggleCompactMode"); + ta = new KToggleAction(i18n("Activate &Compact Mode"), SHIFT + ALT + Key_C, TQT_TQOBJECT(this), TQT_SLOT(slotToggleCompactMode()), ac, "toggleCompactMode"); ta->setChecked(false); - ta = new KToggleAction(i18n("Use R&PN Mode"), SHIFT + ALT + Key_P, this, SLOT(slotToggleExpressionMode()), ac, "toggleExpressionMode"); + ta = new KToggleAction(i18n("Use R&PN Mode"), SHIFT + ALT + Key_P, TQT_TQOBJECT(this), TQT_SLOT(slotToggleExpressionMode()), ac, "toggleExpressionMode"); ta->setChecked(false); // Precision actions. - ta = new KToggleAction(i18n("&Automatic Precision"), 0, this, SLOT(slotPrecisionAuto()), ac, "precisionAuto"); + ta = new KToggleAction(i18n("&Automatic Precision"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecisionAuto()), ac, "precisionAuto"); ta->setExclusiveGroup("Precision"); ta->setChecked(true); - ta = new KToggleAction(i18n("&3 Decimal Digits"), 0, this, SLOT(slotPrecision3()), ac, "precision3"); + ta = new KToggleAction(i18n("&3 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision3()), ac, "precision3"); ta->setExclusiveGroup("Precision"); ta->setChecked(false); - ta = new KToggleAction(i18n("&8 Decimal Digits"), 0, this, SLOT(slotPrecision8()), ac, "precision8"); + ta = new KToggleAction(i18n("&8 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision8()), ac, "precision8"); ta->setExclusiveGroup("Precision"); ta->setChecked(false); - ta = new KToggleAction(i18n("&15 Decimal Digits"), 0, this, SLOT(slotPrecision15()), ac, "precision15"); + ta = new KToggleAction(i18n("&15 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision15()), ac, "precision15"); ta->setExclusiveGroup("Precision"); ta->setChecked(false); - ta = new KToggleAction(i18n("&50 Decimal Digits"), 0, this, SLOT(slotPrecision50()), ac, "precision50"); + ta = new KToggleAction(i18n("&50 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision50()), ac, "precision50"); ta->setExclusiveGroup("Precision"); ta->setChecked(false); - ta = new KToggleAction(i18n("C&ustom Precision..."), 0, this, SLOT(slotPrecisionCustom()), ac, "precisionCustom"); + ta = new KToggleAction(i18n("C&ustom Precision..."), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecisionCustom()), ac, "precisionCustom"); ta->setExclusiveGroup("Precision"); ta->setChecked(false); - new KAction(i18n("Clear &History"), "editclear", SHIFT + ALT + Key_L, m_result, SLOT(clear()), ac, "clearHistory"); + new KAction(i18n("Clear &History"), "editclear", SHIFT + ALT + Key_L, TQT_TQOBJECT(m_result), TQT_SLOT(clear()), ac, "clearHistory"); - new KAction(i18n("Select Editor"), "goto", Key_F6, m_edit, SLOT(setFocus()), ac, "select_edit"); + new KAction(i18n("Select Editor"), "goto", Key_F6, TQT_TQOBJECT(m_edit), TQT_SLOT(setFocus()), ac, "select_edit"); } void MainWindow::populateListViews() { - QStringList values = ValueManager::instance()->valueNames(); + TQStringList values = ValueManager::instance()->valueNames(); Abakus::number_t value = ValueManager::instance()->value("pi"); new ValueListViewItem(m_varList, "pi", value); @@ -575,13 +575,13 @@ KAction *MainWindow::action(const char *key) const return actionCollection()->action(key); } -void MainWindow::slotEntrySelected(const QString &text) +void MainWindow::slotEntrySelected(const TQString &text) { m_edit->setText(text); - m_edit->moveCursor(QTextEdit::MoveEnd, false); + m_edit->moveCursor(TQTextEdit::MoveEnd, false); } -void MainWindow::slotResultSelected(const QString &text) +void MainWindow::slotResultSelected(const TQString &text) { m_edit->insert(text); } @@ -627,42 +627,42 @@ void MainWindow::slotToggleHistoryList() action<KToggleAction>("toggleCompactMode")->setChecked(false); } -void MainWindow::slotNewFunction(const QString &name) +void MainWindow::slotNewFunction(const TQString &name) { UserFunction *userFn = FunctionManager::instance()->function(name)->userFn; UnaryFunction *fn = dynamic_cast<UnaryFunction *>(userFn->fn); - QString fnName = QString("%1(%2)").arg(name, userFn->varName); - QString expr = fn->operand()->infixString(); + TQString fnName = TQString("%1(%2)").tqarg(name, userFn->varName); + TQString expr = fn->operand()->infixString(); new KListViewItem(m_fnList, fnName, expr); } -void MainWindow::slotRemoveFunction(const QString &name) +void MainWindow::slotRemoveFunction(const TQString &name) { UserFunction *userFn = FunctionManager::instance()->function(name)->userFn; - QString fnName = QString("%1(%2)").arg(name, userFn->varName); + TQString fnName = TQString("%1(%2)").tqarg(name, userFn->varName); - QListViewItem *item = 0; - while((item = m_fnList->findItem(fnName, 0)) != 0) + TQListViewItem *item = 0; + while((item = m_fnList->tqfindItem(fnName, 0)) != 0) delete item; } -void MainWindow::slotNewValue(const QString &name, Abakus::number_t value) +void MainWindow::slotNewValue(const TQString &name, Abakus::number_t value) { new ValueListViewItem(m_varList, name, value); } -void MainWindow::slotChangeValue(const QString &name, Abakus::number_t value) +void MainWindow::slotChangeValue(const TQString &name, Abakus::number_t value) { - ValueListViewItem *item = static_cast<ValueListViewItem *>(m_varList->findItem(name, 0)); + ValueListViewItem *item = static_cast<ValueListViewItem *>(m_varList->tqfindItem(name, 0)); if(item) item->valueChanged(value); } -void MainWindow::slotRemoveValue(const QString &name) +void MainWindow::slotRemoveValue(const TQString &name) { - delete m_varList->findItem(name, 0); + delete m_varList->tqfindItem(name, 0); } void MainWindow::slotToggleCompactMode() @@ -681,8 +681,8 @@ void MainWindow::slotToggleCompactMode() action<KToggleAction>("toggleHistoryList")->setChecked(false); m_oldSize = size(); - m_newSize = QSize(0, 0); - QTimer::singleShot(0, this, SLOT(slotUpdateSize())); + m_newSize = TQSize(0, 0); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotUpdateSize())); } else { m_fnList->setShown(m_wasFnShown); @@ -694,7 +694,7 @@ void MainWindow::slotToggleCompactMode() action<KToggleAction>("toggleHistoryList")->setChecked(m_wasHistoryShown); m_newSize = m_oldSize; - QTimer::singleShot(0, this, SLOT(slotUpdateSize())); + TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotUpdateSize())); } } @@ -702,23 +702,23 @@ void MainWindow::slotToggleExpressionMode() { } -QString MainWindow::interpolateExpression(const QString &text, ResultListViewText *after) +TQString MainWindow::interpolateExpression(const TQString &text, ResultListViewText *after) { - QString str(text); - QRegExp stackRE("\\$\\d+"); + TQString str(text); + TQRegExp stackRE("\\$\\d+"); int pos; while((pos = stackRE.search(str)) != -1) { - QString stackStr = stackRE.cap(); + TQString stackStr = stackRE.cap(); Abakus::number_t value; unsigned numPos = stackStr.mid(1).toUInt(); if(!m_result->getStackValue(numPos, value)) { - new ResultListViewText(m_result, text, i18n("Marker %1 isn't set").arg(stackStr), after, true); - return QString::null; + new ResultListViewText(m_result, text, i18n("Marker %1 isn't set").tqarg(stackStr), after, true); + return TQString(); } - str.replace(pos, stackStr.length(), value.toString()); + str.tqreplace(pos, stackStr.length(), value.toString()); } return str; @@ -770,14 +770,14 @@ void MainWindow::slotPrecisionCustom() void MainWindow::redrawResults() { - QListViewItemIterator it(m_result); + TQListViewItemIterator it(m_result); while(it.current()) { static_cast<ResultListViewText *>(it.current())->precisionChanged(); ++it; } - it = QListViewItemIterator (m_varList); + it = TQListViewItemIterator (m_varList); while(it.current()) { static_cast<ValueListViewItem *>(it.current())->valueChanged(); |