diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:52:55 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:52:55 +0000 |
commit | 5f5ee2367157176ed223b86343eb0a9e4022e020 (patch) | |
tree | 6a9c87f14ee38e90eff3c77c784f14e4f38fd5a1 /kcalc | |
parent | 4facf42feec57b22dcf46badc115ad6c5b5cc512 (diff) | |
download | tdeutils-5f5ee2367157176ed223b86343eb0a9e4022e020.tar.gz tdeutils-5f5ee2367157176ed223b86343eb0a9e4022e020.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1157653 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcalc')
-rw-r--r-- | kcalc/confvalues.h | 18 | ||||
-rw-r--r-- | kcalc/dlabel.cpp | 16 | ||||
-rw-r--r-- | kcalc/dlabel.h | 6 | ||||
-rw-r--r-- | kcalc/kcalc.cpp | 708 | ||||
-rw-r--r-- | kcalc/kcalc.h | 48 | ||||
-rw-r--r-- | kcalc/kcalc_button.cpp | 38 | ||||
-rw-r--r-- | kcalc/kcalc_button.h | 32 | ||||
-rw-r--r-- | kcalc/kcalc_const_button.cpp | 20 | ||||
-rw-r--r-- | kcalc/kcalc_const_button.h | 8 | ||||
-rw-r--r-- | kcalc/kcalc_const_menu.cpp | 36 | ||||
-rw-r--r-- | kcalc/kcalc_const_menu.h | 12 | ||||
-rw-r--r-- | kcalc/kcalc_core.h | 4 | ||||
-rw-r--r-- | kcalc/kcalcdisplay.cpp | 82 | ||||
-rw-r--r-- | kcalc/kcalcdisplay.h | 28 | ||||
-rw-r--r-- | kcalc/knumber/knumber.cpp | 54 | ||||
-rw-r--r-- | kcalc/knumber/knumber.h | 8 | ||||
-rw-r--r-- | kcalc/knumber/knumber_priv.cpp | 40 | ||||
-rw-r--r-- | kcalc/knumber/knumber_priv.h | 18 | ||||
-rw-r--r-- | kcalc/knumber/tests/knumbertest.cpp | 22 | ||||
-rw-r--r-- | kcalc/stats.cpp | 8 | ||||
-rw-r--r-- | kcalc/stats.h | 4 |
21 files changed, 605 insertions, 605 deletions
diff --git a/kcalc/confvalues.h b/kcalc/confvalues.h index 0ec1fae..fcfd5e1 100644 --- a/kcalc/confvalues.h +++ b/kcalc/confvalues.h @@ -28,21 +28,21 @@ typedef struct _DefStruct { - QColor forecolor; - QColor backcolor; - QColor numberButtonColor; - QColor functionButtonColor; - QColor statButtonColor; - QColor hexButtonColor; - QColor memoryButtonColor; - QColor operationButtonColor; + TQColor forecolor; + TQColor backcolor; + TQColor numberButtonColor; + TQColor functionButtonColor; + TQColor statButtonColor; + TQColor hexButtonColor; + TQColor memoryButtonColor; + TQColor operationButtonColor; int precision; int fixedprecision; bool fixed; bool beep; bool capres; - QFont font; + TQFont font; } DefStruct; #endif // _CONF_VALUES_H_ diff --git a/kcalc/dlabel.cpp b/kcalc/dlabel.cpp index 8c6c062..c4dbb17 100644 --- a/kcalc/dlabel.cpp +++ b/kcalc/dlabel.cpp @@ -23,7 +23,7 @@ */ -#include <qglobal.h> +#include <tqglobal.h> #include <kactioncollection.h> #include <kstdaction.h> @@ -34,14 +34,14 @@ -DispLogic::DispLogic(QWidget *parent, const char *name, +DispLogic::DispLogic(TQWidget *parent, const char *name, KActionCollection *coll) :KCalcDisplay(parent,name), _history_index(0) { KNumber::setDefaultFloatOutput(true); KNumber::setDefaultFractionalInput(true); - _back = KStdAction::undo(this, SLOT(history_back()), coll); - _forward = KStdAction::redo(this, SLOT(history_forward()), coll); + _back = KStdAction::undo(this, TQT_SLOT(history_back()), coll); + _forward = KStdAction::redo(this, TQT_SLOT(history_forward()), coll); _forward->setEnabled(false); _back->setEnabled(false); @@ -53,11 +53,11 @@ DispLogic::~DispLogic() void DispLogic::changeSettings() { - QPalette pal = palette(); + TQPalette pal = palette(); - pal.setColor(QColorGroup::Text, KCalcSettings::foreColor()); - pal.setColor(QColorGroup::Foreground, KCalcSettings::foreColor()); - pal.setColor(QColorGroup::Background, KCalcSettings::backColor()); + pal.setColor(TQColorGroup::Text, KCalcSettings::foreColor()); + pal.setColor(TQColorGroup::Foreground, KCalcSettings::foreColor()); + pal.setColor(TQColorGroup::Background, KCalcSettings::backColor()); setPalette(pal); setBackgroundColor(KCalcSettings::backColor()); diff --git a/kcalc/dlabel.h b/kcalc/dlabel.h index a9c33c6..0a7c386 100644 --- a/kcalc/dlabel.h +++ b/kcalc/dlabel.h @@ -28,7 +28,7 @@ #ifndef _D_LABEL_H_ #define _D_LABEL_H_ -#include <qvaluevector.h> +#include <tqvaluevector.h> #include "kcalcdisplay.h" class CalcEngine; @@ -40,7 +40,7 @@ class DispLogic : public KCalcDisplay Q_OBJECT public: - DispLogic(QWidget *parent, const char *name, + DispLogic(TQWidget *parent, const char *name, KActionCollection *coll); ~DispLogic(); @@ -54,7 +54,7 @@ private slots: void history_forward(void); private: - QValueVector<KNumber> _history_list; + TQValueVector<KNumber> _history_list; int _history_index; KAction *_forward; diff --git a/kcalc/kcalc.cpp b/kcalc/kcalc.cpp index e7599cf..515536f 100644 --- a/kcalc/kcalc.cpp +++ b/kcalc/kcalc.cpp @@ -28,15 +28,15 @@ #include <unistd.h> -#include <qbuttongroup.h> -#include <qfont.h> -#include <qhbuttongroup.h> -#include <qlayout.h> -#include <qobjectlist.h> -#include <qradiobutton.h> -#include <qspinbox.h> -#include <qstyle.h> -#include <qtooltip.h> +#include <tqbuttongroup.h> +#include <tqfont.h> +#include <tqhbuttongroup.h> +#include <tqlayout.h> +#include <tqobjectlist.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> +#include <tqstyle.h> +#include <tqtooltip.h> @@ -78,18 +78,18 @@ static const char description[] = I18N_NOOP("KDE Calculator"); static const char version[] = KCALCVERSION; -KCalculator::KCalculator(QWidget *parent, const char *name) +KCalculator::KCalculator(TQWidget *parent, const char *name) : KMainWindow(parent, name), inverse(false), hyp_mode(false), memory_num(0.0), calc_display(NULL), mInternalSpacing(4), core() { /* central widget to contain all the elements */ - QWidget *central = new QWidget(this); + TQWidget *central = new TQWidget(this); setCentralWidget(central); KAcceleratorManager::setNoAccel( central ); // Detect color change - connect(kapp,SIGNAL(kdisplayPaletteChanged()), SLOT(set_colors())); + connect(kapp,TQT_SIGNAL(kdisplayPaletteChanged()), TQT_SLOT(set_colors())); calc_display = new DispLogic(central, "display", actionCollection()); @@ -104,32 +104,32 @@ KCalculator::KCalculator(QWidget *parent, const char *name) toolBar()->close(); // Create Button to select BaseMode - BaseChooseGroup = new QHButtonGroup(i18n("Base"), central); - connect(BaseChooseGroup, SIGNAL(clicked(int)), SLOT(slotBaseSelected(int))); - BaseChooseGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed, false); + BaseChooseGroup = new TQHButtonGroup(i18n("Base"), central); + connect(BaseChooseGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotBaseSelected(int))); + BaseChooseGroup->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed, false); - pbBaseChoose[0] = new QRadioButton(i18n("He&x"), BaseChooseGroup, + pbBaseChoose[0] = new TQRadioButton(i18n("He&x"), BaseChooseGroup, "Hexadecimal-Switch"); - QToolTip::add(pbBaseChoose[0], i18n("Switch base to hexadecimal.")); + TQToolTip::add(pbBaseChoose[0], i18n("Switch base to hexadecimal.")); - pbBaseChoose[1] = new QRadioButton(i18n("&Dec"), BaseChooseGroup, + pbBaseChoose[1] = new TQRadioButton(i18n("&Dec"), BaseChooseGroup, "Decimal-Switch"); - QToolTip::add(pbBaseChoose[1], i18n("Switch base to decimal.")); + TQToolTip::add(pbBaseChoose[1], i18n("Switch base to decimal.")); - pbBaseChoose[2] = new QRadioButton(i18n("&Oct"), BaseChooseGroup, + pbBaseChoose[2] = new TQRadioButton(i18n("&Oct"), BaseChooseGroup, "Octal-Switch"); - QToolTip::add(pbBaseChoose[2], i18n("Switch base to octal.")); + TQToolTip::add(pbBaseChoose[2], i18n("Switch base to octal.")); - pbBaseChoose[3] = new QRadioButton(i18n("&Bin"), BaseChooseGroup, + pbBaseChoose[3] = new TQRadioButton(i18n("&Bin"), BaseChooseGroup, "Binary-Switch"); - QToolTip::add(pbBaseChoose[3], i18n("Switch base to binary.")); + TQToolTip::add(pbBaseChoose[3], i18n("Switch base to binary.")); // Create Button to select AngleMode - pbAngleChoose = new QPushButton(i18n("&Angle"), + pbAngleChoose = new TQPushButton(i18n("&Angle"), central, "ChooseAngleMode-Button"); - QToolTip::add(pbAngleChoose, i18n("Choose the unit for the angle measure")); + TQToolTip::add(pbAngleChoose, i18n("Choose the unit for the angle measure")); pbAngleChoose->setAutoDefault(false); KPopupMenu *angle_menu = new KPopupMenu(pbAngleChoose, "AngleMode-Selection-Menu"); @@ -138,7 +138,7 @@ KCalculator::KCalculator(QWidget *parent, const char *name) angle_menu->insertItem(i18n("Gradians"), 2); angle_menu->setCheckable(true); - connect(angle_menu, SIGNAL(activated(int)), SLOT(slotAngleSelected(int))); + connect(angle_menu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotAngleSelected(int))); pbAngleChoose->setPopup(angle_menu); @@ -146,9 +146,9 @@ KCalculator::KCalculator(QWidget *parent, const char *name) pbInv = new KCalcButton("Inv", central, "Inverse-Button", i18n("Inverse mode")); pbInv->setAccel(Key_I); - connect(pbInv, SIGNAL(toggled(bool)), SLOT(slotInvtoggled(bool))); - connect(this, SIGNAL(switchShowAccels(bool)), - pbInv, SLOT(slotSetAccelDisplayMode(bool))); + connect(pbInv, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotInvtoggled(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbInv, TQT_SLOT(slotSetAccelDisplayMode(bool))); pbInv->setToggleButton(true); // @@ -156,8 +156,8 @@ KCalculator::KCalculator(QWidget *parent, const char *name) // // First the widgets that are the parents of the buttons - mSmallPage = new QWidget(central); - mLargePage = new QWidget(central); + mSmallPage = new TQWidget(central); + mLargePage = new TQWidget(central); mNumericPage = setupNumericKeys(central); setupLogicKeys(mSmallPage); @@ -170,25 +170,25 @@ KCalculator::KCalculator(QWidget *parent, const char *name) pbMod->addMode(ModeNormal, "Mod", i18n("Modulo")); pbMod->addMode(ModeInverse, "IntDiv", i18n("Integer division")); pbMod->setAccel(Key_Colon); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - pbMod, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMod, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMod, SIGNAL(clicked(void)), SLOT(slotModclicked(void))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + pbMod, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMod, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMod, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotModclicked(void))); pbReci = new KCalcButton(mSmallPage, "Reciprocal-Button"); pbReci->addMode(ModeNormal, "1/x", i18n("Reciprocal")); pbReci->setAccel(Key_R); - connect(this, SIGNAL(switchShowAccels(bool)), - pbReci, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbReci, SIGNAL(clicked(void)), SLOT(slotReciclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbReci, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbReci, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotReciclicked(void))); pbFactorial = new KCalcButton(mSmallPage, "Factorial-Button"); pbFactorial->addMode(ModeNormal, "x!", i18n("Factorial")); pbFactorial->setAccel(Key_Exclam); - connect(this, SIGNAL(switchShowAccels(bool)), - pbFactorial, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbFactorial, SIGNAL(clicked(void)),SLOT(slotFactorialclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbFactorial, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbFactorial, TQT_SIGNAL(clicked(void)),TQT_SLOT(slotFactorialclicked(void))); // Representation of x^2 is moved to the function // changeRepresentation() that paints the letters When @@ -197,20 +197,20 @@ KCalculator::KCalculator(QWidget *parent, const char *name) pbSquare = new KCalcButton(mSmallPage, "Square-Button"); pbSquare->addMode(ModeNormal, "x<sup>2</sup>", i18n("Square"), true); pbSquare->addMode(ModeInverse, "x<sup>3</sup>", i18n("Third power"), true); - connect(this, SIGNAL(switchShowAccels(bool)), - pbSquare, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - pbSquare, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(pbSquare, SIGNAL(clicked(void)), SLOT(slotSquareclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbSquare, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + pbSquare, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(pbSquare, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotSquareclicked(void))); pbRoot = new KSquareButton(mSmallPage, "Square-Button"); pbRoot->addMode(ModeNormal, "sqrt(x)", i18n("Square root")); pbRoot->addMode(ModeInverse, "sqrt[3](x)", i18n("Cube root")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbRoot, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - pbRoot, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(pbRoot, SIGNAL(clicked(void)), SLOT(slotRootclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbRoot, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + pbRoot, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(pbRoot, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotRootclicked(void))); // Representation of x^y is moved to the function @@ -219,28 +219,28 @@ KCalculator::KCalculator(QWidget *parent, const char *name) pbPower = new KCalcButton(mSmallPage, "Power-Button"); pbPower->addMode(ModeNormal, "x<sup>y</sup>", i18n("x to the power of y"), true); pbPower->addMode(ModeInverse, "x<sup>1/y</sup>", i18n("x to the power of 1/y"), true); - connect(this, SIGNAL(switchShowAccels(bool)), - pbPower, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - pbPower, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbPower, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + pbPower, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); pbPower->setAccel(Key_AsciiCircum); - connect(pbPower, SIGNAL(clicked(void)), SLOT(slotPowerclicked(void))); + connect(pbPower, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotPowerclicked(void))); // // All these layouts are needed because all the groups have their - // own size per row so we can't use one huge QGridLayout (mosfet) + // own size per row so we can't use one huge TQGridLayout (mosfet) // - QGridLayout *smallBtnLayout = new QGridLayout(mSmallPage, 6, 4, 0, + TQGridLayout *smallBtnLayout = new TQGridLayout(mSmallPage, 6, 4, 0, mInternalSpacing); - QGridLayout *largeBtnLayout = new QGridLayout(mLargePage, 5, 2, 0, + TQGridLayout *largeBtnLayout = new TQGridLayout(mLargePage, 5, 2, 0, mInternalSpacing); - QHBoxLayout *topLayout = new QHBoxLayout(); - QHBoxLayout *btnLayout = new QHBoxLayout(); + TQHBoxLayout *topLayout = new TQHBoxLayout(); + TQHBoxLayout *btnLayout = new TQHBoxLayout(); // bring them all together - QVBoxLayout *mainLayout = new QVBoxLayout(central, mInternalSpacing, + TQVBoxLayout *mainLayout = new TQVBoxLayout(central, mInternalSpacing, mInternalSpacing); mainLayout->addLayout(topLayout); @@ -369,8 +369,8 @@ KCalculator::KCalculator(QWidget *parent, const char *name) // Show the result in the app's caption in taskbar (wishlist - bug #52858) if (KCalcSettings::captionResult() == true) connect(calc_display, - SIGNAL(changedText(const QString &)), - SLOT(setCaption(const QString &))); + TQT_SIGNAL(changedText(const TQString &)), + TQT_SLOT(setCaption(const TQString &))); calc_display->changeSettings(); set_precision(); @@ -409,48 +409,48 @@ KCalculator::~KCalculator() void KCalculator::setupMainActions(void) { // file menu - KStdAction::quit(this, SLOT(close()), actionCollection()); + KStdAction::quit(this, TQT_SLOT(close()), actionCollection()); // edit menu - KStdAction::cut(calc_display, SLOT(slotCut()), actionCollection()); - KStdAction::copy(calc_display, SLOT(slotCopy()), actionCollection()); - KStdAction::paste(calc_display, SLOT(slotPaste()), actionCollection()); + KStdAction::cut(calc_display, TQT_SLOT(slotCut()), actionCollection()); + KStdAction::copy(calc_display, TQT_SLOT(slotCopy()), actionCollection()); + KStdAction::paste(calc_display, TQT_SLOT(slotPaste()), actionCollection()); // settings menu actionStatshow = new KToggleAction(i18n("&Statistic Buttons"), 0, actionCollection(), "show_stat"); actionStatshow->setChecked(true); - connect(actionStatshow, SIGNAL(toggled(bool)), - SLOT(slotStatshow(bool))); + connect(actionStatshow, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotStatshow(bool))); actionScientificshow = new KToggleAction(i18n("Science/&Engineering Buttons"), 0, actionCollection(), "show_science"); actionScientificshow->setChecked(true); - connect(actionScientificshow, SIGNAL(toggled(bool)), - SLOT(slotScientificshow(bool))); + connect(actionScientificshow, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotScientificshow(bool))); actionLogicshow = new KToggleAction(i18n("&Logic Buttons"), 0, actionCollection(), "show_logic"); actionLogicshow->setChecked(true); - connect(actionLogicshow, SIGNAL(toggled(bool)), - SLOT(slotLogicshow(bool))); + connect(actionLogicshow, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotLogicshow(bool))); actionConstantsShow = new KToggleAction(i18n("&Constants Buttons"), 0, actionCollection(), "show_constants"); actionConstantsShow->setChecked(true); - connect(actionConstantsShow, SIGNAL(toggled(bool)), - SLOT(slotConstantsShow(bool))); + connect(actionConstantsShow, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotConstantsShow(bool))); - (void) new KAction(i18n("&Show All"), 0, this, SLOT(slotShowAll()), + (void) new KAction(i18n("&Show All"), 0, this, TQT_SLOT(slotShowAll()), actionCollection(), "show_all"); - (void) new KAction(i18n("&Hide All"), 0, this, SLOT(slotHideAll()), + (void) new KAction(i18n("&Hide All"), 0, this, TQT_SLOT(slotHideAll()), actionCollection(), "hide_all"); - KStdAction::preferences(this, SLOT(showSettings()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); } @@ -471,141 +471,141 @@ void KCalculator::setupStatusbar(void) statusBar()->setItemAlignment(3, AlignCenter); } -QWidget* KCalculator::setupNumericKeys(QWidget *parent) +TQWidget* KCalculator::setupNumericKeys(TQWidget *parent) { Q_CHECK_PTR(mSmallPage); Q_CHECK_PTR(mLargePage); - QWidget *thisPage = new QWidget(parent); + TQWidget *thisPage = new TQWidget(parent); KCalcButton *tmp_pb; - NumButtonGroup = new QButtonGroup(0, "Num-Button-Group"); - connect(NumButtonGroup, SIGNAL(clicked(int)), - SLOT(slotNumberclicked(int))); + NumButtonGroup = new TQButtonGroup(0, "Num-Button-Group"); + connect(NumButtonGroup, TQT_SIGNAL(clicked(int)), + TQT_SLOT(slotNumberclicked(int))); tmp_pb = new KCalcButton("0", thisPage, "0-Button"); tmp_pb->setAccel(Key_0); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0); tmp_pb = new KCalcButton("1", thisPage, "1-Button"); tmp_pb->setAccel(Key_1); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 1); tmp_pb = new KCalcButton("2", thisPage, "2-Button"); tmp_pb->setAccel(Key_2); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 2); tmp_pb = new KCalcButton("3", thisPage, "3-Button"); tmp_pb->setAccel(Key_3); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 3); tmp_pb = new KCalcButton("4", thisPage, "4-Button"); tmp_pb->setAccel(Key_4); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 4); tmp_pb = new KCalcButton("5", thisPage, "5-Button"); tmp_pb->setAccel(Key_5); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 5); tmp_pb = new KCalcButton("6", thisPage, "6-Button"); tmp_pb->setAccel(Key_6); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 6); tmp_pb = new KCalcButton("7", thisPage, "7-Button"); tmp_pb->setAccel(Key_7); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 7); tmp_pb = new KCalcButton("8", thisPage, "8-Button"); tmp_pb->setAccel(Key_8); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 8); tmp_pb = new KCalcButton("9", thisPage, "9-Button"); tmp_pb->setAccel(Key_9); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 9); pbEE = new KCalcButton(thisPage, "EE-Button"); pbEE->addMode(ModeNormal, "x<small>" "\xb7" "10</small><sup>y</sup>", i18n("Exponent"), true); pbEE->setAccel(Key_E); - connect(this, SIGNAL(switchShowAccels(bool)), - pbEE, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbEE, SIGNAL(clicked(void)), SLOT(slotEEclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbEE, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbEE, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotEEclicked(void))); pbParenClose = new KCalcButton(")", mLargePage, "ParenClose-Button"); pbParenClose->setAccel(Key_ParenRight); - connect(this, SIGNAL(switchShowAccels(bool)), - pbParenClose, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbParenClose,SIGNAL(clicked(void)),SLOT(slotParenCloseclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbParenClose, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbParenClose,TQT_SIGNAL(clicked(void)),TQT_SLOT(slotParenCloseclicked(void))); pbX = new KCalcButton("X", thisPage, "Multiply-Button", i18n("Multiplication")); pbX->setAccel(Key_multiply); - connect(this, SIGNAL(switchShowAccels(bool)), - pbX, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbX, TQT_SLOT(slotSetAccelDisplayMode(bool))); accel()->insert("Pressed '*'", i18n("Pressed Multiplication-Button"), - 0, Key_Asterisk, pbX, SLOT(animateClick())); - connect(pbX, SIGNAL(clicked(void)), SLOT(slotXclicked(void))); + 0, Key_Asterisk, pbX, TQT_SLOT(animateClick())); + connect(pbX, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotXclicked(void))); pbDivision = new KCalcButton("/", thisPage, "Division-Button", i18n("Division")); pbDivision->setAccel(Key_Slash); - connect(this, SIGNAL(switchShowAccels(bool)), - pbDivision, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbDivision, SIGNAL(clicked(void)), SLOT(slotDivisionclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbDivision, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbDivision, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotDivisionclicked(void))); pbPlus = new KCalcButton("+", thisPage, "Plus-Button", i18n("Addition")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbPlus, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbPlus, TQT_SLOT(slotSetAccelDisplayMode(bool))); pbPlus->setAccel(Key_Plus); - connect(pbPlus, SIGNAL(clicked(void)), SLOT(slotPlusclicked(void))); + connect(pbPlus, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotPlusclicked(void))); pbMinus = new KCalcButton("-", thisPage, "Minus-Button", i18n("Subtraction")); pbMinus->setAccel(Key_Minus); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMinus, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMinus, SIGNAL(clicked(void)), SLOT(slotMinusclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMinus, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMinus, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotMinusclicked(void))); pbPeriod = new KCalcButton(KGlobal::locale()->decimalSymbol(), thisPage, "Period-Button", i18n("Decimal point")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbPeriod, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbPeriod, TQT_SLOT(slotSetAccelDisplayMode(bool))); accel()->insert("Decimal Point (Period)", i18n("Pressed Decimal Point"), - 0, Key_Period, pbPeriod, SLOT(animateClick())); + 0, Key_Period, pbPeriod, TQT_SLOT(animateClick())); accel()->insert("Decimal Point (Comma)", i18n("Pressed Decimal Point"), - 0, Key_Comma, pbPeriod, SLOT(animateClick())); - connect(pbPeriod, SIGNAL(clicked(void)), SLOT(slotPeriodclicked(void))); + 0, Key_Comma, pbPeriod, TQT_SLOT(animateClick())); + connect(pbPeriod, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotPeriodclicked(void))); pbEqual = new KCalcButton("=", thisPage, "Equal-Button", i18n("Result")); pbEqual->setAccel(Key_Enter); - connect(this, SIGNAL(switchShowAccels(bool)), - pbEqual, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbEqual, TQT_SLOT(slotSetAccelDisplayMode(bool))); accel()->insert("Entered Equal", i18n("Pressed Equal-Button"), - 0, Key_Equal, pbEqual, SLOT(animateClick())); + 0, Key_Equal, pbEqual, TQT_SLOT(animateClick())); accel()->insert("Entered Return", i18n("Pressed Equal-Button"), - 0, Key_Return, pbEqual, SLOT(animateClick())); - connect(pbEqual, SIGNAL(clicked(void)), SLOT(slotEqualclicked(void))); + 0, Key_Return, pbEqual, TQT_SLOT(animateClick())); + connect(pbEqual, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotEqualclicked(void))); - QGridLayout *thisLayout = new QGridLayout(thisPage, 5, 4, 0, + TQGridLayout *thisLayout = new TQGridLayout(thisPage, 5, 4, 0, mInternalSpacing); // large button layout @@ -641,107 +641,107 @@ QWidget* KCalculator::setupNumericKeys(QWidget *parent) pbMemRecall = new KCalcButton("MR", mLargePage, "MemRecall-Button", i18n("Memory recall")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMemRecall, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMemRecall, SIGNAL(clicked(void)), - SLOT(slotMemRecallclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMemRecall, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMemRecall, TQT_SIGNAL(clicked(void)), + TQT_SLOT(slotMemRecallclicked(void))); pbMemRecall->setDisabled(true); // At start, there is nothing in memory pbMemPlusMinus = new KCalcButton(mLargePage, "MPlusMinus-Button"); pbMemPlusMinus->addMode(ModeNormal, "M+", i18n("Add display to memory")); pbMemPlusMinus->addMode(ModeInverse, "M-", i18n("Subtract from memory")); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - pbMemPlusMinus, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMemPlusMinus, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMemPlusMinus,SIGNAL(clicked(void)), - SLOT(slotMemPlusMinusclicked(void))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + pbMemPlusMinus, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMemPlusMinus, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMemPlusMinus,TQT_SIGNAL(clicked(void)), + TQT_SLOT(slotMemPlusMinusclicked(void))); pbMemStore = new KCalcButton("MS", mLargePage, "MemStore-Button", i18n("Memory store")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMemStore, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMemStore, SIGNAL(clicked(void)), SLOT(slotMemStoreclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMemStore, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMemStore, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotMemStoreclicked(void))); pbMC = new KCalcButton("MC", mLargePage, "MemClear-Button", i18n("Clear memory")); - connect(this, SIGNAL(switchShowAccels(bool)), - pbMC, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbMC, SIGNAL(clicked(void)), SLOT(slotMCclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbMC, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbMC, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotMCclicked(void))); pbClear = new KCalcButton("C", mLargePage, "Clear-Button", i18n("Clear")); pbClear->setAccel(Key_Prior); - connect(this, SIGNAL(switchShowAccels(bool)), - pbClear, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbClear, TQT_SLOT(slotSetAccelDisplayMode(bool))); accel()->insert("Entered 'ESC'", i18n("Pressed ESC-Button"), 0, - Key_Escape, pbClear, SLOT(animateClick())); - connect(pbClear, SIGNAL(clicked(void)), SLOT(slotClearclicked(void))); + Key_Escape, pbClear, TQT_SLOT(animateClick())); + connect(pbClear, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotClearclicked(void))); pbAC = new KCalcButton("AC", mLargePage, "AC-Button", i18n("Clear all")); pbAC->setAccel(Key_Delete); - connect(this, SIGNAL(switchShowAccels(bool)), - pbAC, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbAC, SIGNAL(clicked(void)), SLOT(slotACclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbAC, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbAC, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotACclicked(void))); pbParenOpen = new KCalcButton("(", mLargePage, "ParenOpen-Button"); pbParenOpen->setAccel(Key_ParenLeft); - connect(this, SIGNAL(switchShowAccels(bool)), - pbParenOpen, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbParenOpen, SIGNAL(clicked(void)),SLOT(slotParenOpenclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbParenOpen, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbParenOpen, TQT_SIGNAL(clicked(void)),TQT_SLOT(slotParenOpenclicked(void))); pbPercent = new KCalcButton("%", mLargePage, "Percent-Button", i18n("Percent")); pbPercent->setAccel(Key_Percent); - connect(this, SIGNAL(switchShowAccels(bool)), - pbPercent, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbPercent, SIGNAL(clicked(void)), SLOT(slotPercentclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbPercent, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbPercent, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotPercentclicked(void))); pbPlusMinus = new KCalcButton("\xb1", mLargePage, "Sign-Button", i18n("Change sign")); pbPlusMinus->setAccel(Key_Backslash); - connect(this, SIGNAL(switchShowAccels(bool)), - pbPlusMinus, SLOT(slotSetAccelDisplayMode(bool))); - connect(pbPlusMinus, SIGNAL(clicked(void)), SLOT(slotPlusMinusclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + pbPlusMinus, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(pbPlusMinus, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotPlusMinusclicked(void))); tmp_pb = new KCalcButton("A", mSmallPage, "A-Button"); tmp_pb->setAccel(Key_A); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xA); tmp_pb = new KCalcButton("B", mSmallPage, "B-Button"); tmp_pb->setAccel(Key_B); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xB); tmp_pb = new KCalcButton("C", mSmallPage, "C-Button"); tmp_pb->setAccel(Key_C); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xC); tmp_pb = new KCalcButton("D", mSmallPage, "D-Button"); tmp_pb->setAccel(Key_D); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xD); tmp_pb = new KCalcButton("E", mSmallPage, "E-Button"); tmp_pb->setAccel(Key_E); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xE); tmp_pb = new KCalcButton("F", mSmallPage, "F-Button"); tmp_pb->setAccel(Key_F); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); NumButtonGroup->insert(tmp_pb, 0xF); return thisPage; } -void KCalculator::setupLogicKeys(QWidget *parent) +void KCalculator::setupLogicKeys(TQWidget *parent) { Q_CHECK_PTR(parent); @@ -750,51 +750,51 @@ void KCalculator::setupLogicKeys(QWidget *parent) tmp_pb = new KCalcButton("AND", parent, "AND-Button", i18n("Bitwise AND")); pbLogic.insert("AND", tmp_pb); tmp_pb->setAccel(Key_Ampersand); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotANDclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotANDclicked(void))); tmp_pb = new KCalcButton("OR", parent, "OR-Button", i18n("Bitwise OR")); pbLogic.insert("OR", tmp_pb); tmp_pb->setAccel(Key_Bar); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotORclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotORclicked(void))); tmp_pb = new KCalcButton("XOR", parent, "XOR-Button", i18n("Bitwise XOR")); pbLogic.insert("XOR", tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotXORclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotXORclicked(void))); tmp_pb = new KCalcButton("Cmp", parent, "One-Complement-Button", i18n("One's complement")); pbLogic.insert("One-Complement", tmp_pb); tmp_pb->setAccel(Key_AsciiTilde); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotNegateclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotNegateclicked(void))); tmp_pb = new KCalcButton("Lsh", parent, "LeftBitShift-Button", i18n("Left bit shift")); tmp_pb->setAccel(Key_Less); pbLogic.insert("LeftShift", tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), - SLOT(slotLeftShiftclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), + TQT_SLOT(slotLeftShiftclicked(void))); tmp_pb = new KCalcButton("Rsh", parent, "RightBitShift-Button", i18n("Right bit shift")); tmp_pb->setAccel(Key_Greater); pbLogic.insert("RightShift", tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), - SLOT(slotRightShiftclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), + TQT_SLOT(slotRightShiftclicked(void))); } -void KCalculator::setupScientificKeys(QWidget *parent) +void KCalculator::setupScientificKeys(TQWidget *parent) { Q_CHECK_PTR(parent); @@ -803,9 +803,9 @@ void KCalculator::setupScientificKeys(QWidget *parent) tmp_pb = new KCalcButton("Hyp", parent, "Hyp-Button", i18n("Hyperbolic mode")); pbScientific.insert("HypMode", tmp_pb); tmp_pb->setAccel(Key_H); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(toggled(bool)), SLOT(slotHyptoggled(bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotHyptoggled(bool))); tmp_pb->setToggleButton(true); tmp_pb = new KCalcButton(parent, "Sin-Button"); @@ -816,11 +816,11 @@ void KCalculator::setupScientificKeys(QWidget *parent) tmp_pb->addMode(ButtonModeFlags(ModeInverse | ModeHyperbolic), "Asinh", i18n("Inverse hyperbolic sine")); tmp_pb->setAccel(Key_S); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotSinclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotSinclicked(void))); tmp_pb = new KCalcButton(parent, "Cos-Button"); pbScientific.insert("Cosine", tmp_pb); @@ -830,11 +830,11 @@ void KCalculator::setupScientificKeys(QWidget *parent) tmp_pb->addMode(ButtonModeFlags(ModeInverse | ModeHyperbolic), "Acosh", i18n("Inverse hyperbolic cosine")); tmp_pb->setAccel(Key_C); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotCosclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotCosclicked(void))); tmp_pb = new KCalcButton(parent, "Tan-Button"); pbScientific.insert("Tangent", tmp_pb); @@ -844,11 +844,11 @@ void KCalculator::setupScientificKeys(QWidget *parent) tmp_pb->addMode(ButtonModeFlags(ModeInverse | ModeHyperbolic), "Atanh", i18n("Inverse hyperbolic tangent")); tmp_pb->setAccel(Key_T); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)),SLOT(slotTanclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)),TQT_SLOT(slotTanclicked(void))); tmp_pb = new KCalcButton(parent, "Ln-Button"); tmp_pb->addMode(ModeNormal, "Ln", i18n("Natural log")); @@ -856,11 +856,11 @@ void KCalculator::setupScientificKeys(QWidget *parent) true); pbScientific.insert("LogNatural", tmp_pb); tmp_pb->setAccel(Key_N); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotLnclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotLnclicked(void))); tmp_pb = new KCalcButton(parent, "Log-Button"); tmp_pb->addMode(ModeNormal, "Log", i18n("Logarithm to base 10")); @@ -868,15 +868,15 @@ void KCalculator::setupScientificKeys(QWidget *parent) true); pbScientific.insert("Log10", tmp_pb); tmp_pb->setAccel(Key_L); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotLogclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotLogclicked(void))); } -void KCalculator::setupStatisticKeys(QWidget *parent) +void KCalculator::setupStatisticKeys(TQWidget *parent) { Q_CHECK_PTR(parent); @@ -884,132 +884,132 @@ void KCalculator::setupStatisticKeys(QWidget *parent) tmp_pb = new KCalcButton(parent, "Stat.NumData-Button"); tmp_pb->addMode(ModeNormal, "N", i18n("Number of data entered")); - tmp_pb->addMode(ModeInverse, QString::fromUtf8("\xce\xa3") + tmp_pb->addMode(ModeInverse, TQString::fromUtf8("\xce\xa3") + "x", i18n("Sum of all data items")); pbStat.insert("NumData", tmp_pb); mStatButtonList.append(tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatNumclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatNumclicked(void))); tmp_pb = new KCalcButton(parent, "Stat.Median-Button"); tmp_pb->addMode(ModeNormal, "Med", i18n("Median")); pbStat.insert("Median", tmp_pb); mStatButtonList.append(tmp_pb); - QToolTip::add(tmp_pb, i18n("Median")); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatMedianclicked(void))); + TQToolTip::add(tmp_pb, i18n("Median")); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatMedianclicked(void))); tmp_pb = new KCalcButton(parent, "Stat.Mean-Button"); tmp_pb->addMode(ModeNormal, "Mea", i18n("Mean")); - tmp_pb->addMode(ModeInverse, QString::fromUtf8("\xce\xa3") + tmp_pb->addMode(ModeInverse, TQString::fromUtf8("\xce\xa3") + "x<sup>2</sup>", i18n("Sum of all data items squared"), true); pbStat.insert("Mean", tmp_pb); mStatButtonList.append(tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatMeanclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatMeanclicked(void))); tmp_pb = new KCalcButton(parent, "Stat.StandardDeviation-Button"); - tmp_pb->addMode(ModeNormal, QString::fromUtf8("σ",-1) + "<sub>N-1</sub>", + tmp_pb->addMode(ModeNormal, TQString::fromUtf8("σ",-1) + "<sub>N-1</sub>", i18n("Sample standard deviation"), true); - tmp_pb->addMode(ModeInverse, QString::fromUtf8("σ",-1) + "<sub>N</sub>", + tmp_pb->addMode(ModeInverse, TQString::fromUtf8("σ",-1) + "<sub>N</sub>", i18n("Standard deviation"), true); pbStat.insert("StandardDeviation", tmp_pb); mStatButtonList.append(tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatStdDevclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatStdDevclicked(void))); tmp_pb = new KCalcButton(parent, "Stat.DataInput-Button"); tmp_pb->addMode(ModeNormal, "Dat", i18n("Enter data")); tmp_pb->addMode(ModeInverse, "CDat", i18n("Delete last data item")); pbStat.insert("InputData", tmp_pb); mStatButtonList.append(tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatDataInputclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatDataInputclicked(void))); tmp_pb = new KCalcButton(parent, "Stat.ClearData-Button"); tmp_pb->addMode(ModeNormal, "CSt", i18n("Clear data store")); pbStat.insert("ClearData", tmp_pb); mStatButtonList.append(tmp_pb); - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(tmp_pb, SIGNAL(clicked(void)), SLOT(slotStatClearDataclicked(void))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(tmp_pb, TQT_SIGNAL(clicked(void)), TQT_SLOT(slotStatClearDataclicked(void))); } -void KCalculator::setupConstantsKeys(QWidget *parent) +void KCalculator::setupConstantsKeys(TQWidget *parent) { Q_CHECK_PTR(parent); - ConstButtonGroup = new QButtonGroup(0, "Const-Button-Group"); - connect(ConstButtonGroup, SIGNAL(clicked(int)), SLOT(slotConstclicked(int))); + ConstButtonGroup = new TQButtonGroup(0, "Const-Button-Group"); + connect(ConstButtonGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotConstclicked(int))); KCalcConstButton *tmp_pb; tmp_pb = new KCalcConstButton(parent, 0, "C1"); tmp_pb->setAccel(ALT + Key_1); pbConstant[0] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 0); tmp_pb = new KCalcConstButton(parent, 1, "C2"); tmp_pb->setAccel(ALT + Key_2); pbConstant[1] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 1); tmp_pb = new KCalcConstButton(parent, 2, "C3"); tmp_pb->setAccel(ALT + Key_3); pbConstant[2] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 2); tmp_pb = new KCalcConstButton(parent, 3, "C4"); tmp_pb->setAccel(ALT + Key_4); pbConstant[3] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 3); tmp_pb = new KCalcConstButton(parent, 4, "C5"); tmp_pb->setAccel(ALT + Key_5); pbConstant[4] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 4); tmp_pb = new KCalcConstButton(parent, 5, "C6"); tmp_pb->setAccel(ALT + Key_6); pbConstant[5] = tmp_pb; - connect(this, SIGNAL(switchShowAccels(bool)), - tmp_pb, SLOT(slotSetAccelDisplayMode(bool))); - connect(this, SIGNAL(switchMode(ButtonModeFlags,bool)), - tmp_pb, SLOT(slotSetMode(ButtonModeFlags,bool))); + connect(this, TQT_SIGNAL(switchShowAccels(bool)), + tmp_pb, TQT_SLOT(slotSetAccelDisplayMode(bool))); + connect(this, TQT_SIGNAL(switchMode(ButtonModeFlags,bool)), + tmp_pb, TQT_SLOT(slotSetMode(ButtonModeFlags,bool))); ConstButtonGroup->insert(tmp_pb, 5); changeButtonNames(); @@ -1017,8 +1017,8 @@ void KCalculator::setupConstantsKeys(QWidget *parent) // add menu with scientific constants KCalcConstMenu *tmp_menu = new KCalcConstMenu(this); menuBar()->insertItem(i18n("&Constants"), tmp_menu, -1, 2); - connect(tmp_menu, SIGNAL(activated(int)), this, - SLOT(slotConstantToDisplay(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), this, + TQT_SLOT(slotConstantToDisplay(int))); } void KCalculator::slotConstantToDisplay(int constant) @@ -1030,8 +1030,8 @@ void KCalculator::slotConstantToDisplay(int constant) void KCalculator::updateGeometry(void) { - QObjectList *l; - QSize s; + TQObjectList *l; + TQSize s; int margin; // @@ -1041,16 +1041,16 @@ void KCalculator::updateGeometry(void) s.setHeight(mSmallPage->fontMetrics().lineSpacing()); // why this stupid cast! - l = const_cast<QObjectList *>(mSmallPage->children()); + l = const_cast<TQObjectList *>(mSmallPage->children()); for(uint i=0; i < l->count(); i++) { - QObject *o = l->at(i); + TQObject *o = l->at(i); if( o->isWidgetType() ) { - QWidget *tmp_widget = dynamic_cast<QWidget *>(o); - margin = QApplication::style(). - pixelMetric(QStyle::PM_ButtonMargin, (tmp_widget))*2; + TQWidget *tmp_widget = dynamic_cast<TQWidget *>(o); + margin = TQApplication::style(). + pixelMetric(TQStyle::PM_ButtonMargin, (tmp_widget))*2; tmp_widget->setFixedSize(s.width()+margin, s.height()+margin); //tmp_widget->setMinimumSize(s.width()+margin, s.height()+margin); tmp_widget->installEventFilter( this ); @@ -1059,21 +1059,21 @@ void KCalculator::updateGeometry(void) } // why this stupic cast !! - l = const_cast<QObjectList*>(mLargePage->children()); + l = const_cast<TQObjectList*>(mLargePage->children()); int h1 = (NumButtonGroup->find(0x0F))->minimumSize().height(); int h2 = static_cast<int>( (static_cast<float>(h1) + 4.0) / 5.0 ); s.setWidth(mLargePage->fontMetrics().width("MMM") + - QApplication::style(). - pixelMetric(QStyle::PM_ButtonMargin, NumButtonGroup->find(0x0F))*2); + TQApplication::style(). + pixelMetric(TQStyle::PM_ButtonMargin, NumButtonGroup->find(0x0F))*2); s.setHeight(h1 + h2); for(uint i = 0; i < l->count(); i++) { - QObject *o = l->at(i); + TQObject *o = l->at(i); if(o->isWidgetType()) { - QWidget *tmp_widget = dynamic_cast<QWidget *>(o); + TQWidget *tmp_widget = dynamic_cast<TQWidget *>(o); tmp_widget->setFixedSize(s); tmp_widget->installEventFilter(this); tmp_widget->setAcceptDrops(true); @@ -1086,21 +1086,21 @@ void KCalculator::updateGeometry(void) - l = (QObjectList*)mNumericPage->children(); // silence please + l = (TQObjectList*)mNumericPage->children(); // silence please h1 = (NumButtonGroup->find(0x0F))->minimumSize().height(); h2 = (int)((((float)h1 + 4.0) / 5.0)); s.setWidth(mLargePage->fontMetrics().width("MMM") + - QApplication::style(). - pixelMetric(QStyle::PM_ButtonMargin, NumButtonGroup->find(0x0F))*2); + TQApplication::style(). + pixelMetric(TQStyle::PM_ButtonMargin, NumButtonGroup->find(0x0F))*2); s.setHeight(h1 + h2); for(uint i = 0; i < l->count(); i++) { - QObject *o = l->at(i); + TQObject *o = l->at(i); if(o->isWidgetType()) { - QWidget *tmp_widget = dynamic_cast<QWidget *>(o); + TQWidget *tmp_widget = dynamic_cast<TQWidget *>(o); tmp_widget->setFixedSize(s); tmp_widget->installEventFilter(this); tmp_widget->setAcceptDrops(true); @@ -1108,7 +1108,7 @@ void KCalculator::updateGeometry(void) } // Set Buttons of double size - QSize t(s); + TQSize t(s); t.setWidth(2*s.width()); NumButtonGroup->find(0x00)->setFixedSize(t); t = s; @@ -1185,7 +1185,7 @@ void KCalculator::slotBaseSelected(int base) } } -void KCalculator::keyPressEvent(QKeyEvent *e) +void KCalculator::keyPressEvent(TQKeyEvent *e) { if ( ( e->state() & KeyButtonMask ) == 0 || ( e->state() & ShiftButton ) ) { switch (e->key()) @@ -1215,7 +1215,7 @@ void KCalculator::keyPressEvent(QKeyEvent *e) emit switchShowAccels(true); } -void KCalculator::keyReleaseEvent(QKeyEvent *e) +void KCalculator::keyReleaseEvent(TQKeyEvent *e) { if (e->key() == Key_Control) emit switchShowAccels(false); @@ -1271,7 +1271,7 @@ void KCalculator::slotInvtoggled(bool flag) else { statusBar()->changeItem("NORM", 0); - calc_display->setStatusText(0, QString::null); + calc_display->setStatusText(0, TQString::null); } } @@ -1544,7 +1544,7 @@ void KCalculator::slotMCclicked(void) { memory_num = 0; statusBar()->changeItem(" \xa0\xa0 ",3); - calc_display->setStatusText(3, QString::null); + calc_display->setStatusText(3, TQString::null); pbMemRecall->setDisabled(true); } @@ -1824,10 +1824,10 @@ void KCalculator::showSettings() general->kcfg_Precision->setMaxValue(maxprec); dialog->addPage(general, i18n("General"), "package_settings", i18n("General Settings")); - QWidget *fontWidget = new QWidget(0,"Font"); - QVBoxLayout *fontLayout = new QVBoxLayout(fontWidget); + TQWidget *fontWidget = new TQWidget(0,"Font"); + TQVBoxLayout *fontLayout = new TQVBoxLayout(fontWidget); KFontChooser *mFontChooser = - new KFontChooser(fontWidget, "kcfg_Font", false, QStringList(), false, 6); + new KFontChooser(fontWidget, "kcfg_Font", false, TQStringList(), false, 6); fontLayout->addWidget(mFontChooser); dialog->addPage(fontWidget, i18n("Font"), "fonts", i18n("Select Display Font")); @@ -1844,40 +1844,40 @@ void KCalculator::showSettings() tmp_const = constant; KCalcConstMenu *tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst0(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst0(int))); (constant->kPushButton0)->setPopup(tmp_menu); tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst1(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst1(int))); (constant->kPushButton1)->setPopup(tmp_menu); tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst2(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst2(int))); (constant->kPushButton2)->setPopup(tmp_menu); tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst3(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst3(int))); (constant->kPushButton3)->setPopup(tmp_menu); tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst4(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst4(int))); (constant->kPushButton4)->setPopup(tmp_menu); tmp_menu = new KCalcConstMenu(this); - connect(tmp_menu, SIGNAL(activated(int)), - SLOT(slotChooseScientificConst5(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotChooseScientificConst5(int))); (constant->kPushButton5)->setPopup(tmp_menu); dialog->addPage(constant, i18n("Constants"), "constants"); // When the user clicks OK or Apply we want to update our settings. - connect(dialog, SIGNAL(settingsChanged()), SLOT(updateSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_SLOT(updateSettings())); // Display the dialog. dialog->show(); @@ -1983,7 +1983,7 @@ void KCalculator::slotScientificshow(bool toggled) pbAngleChoose->hide(); if(statusBar()->hasItem(2)) statusBar()->removeItem(2); - calc_display->setStatusText(2, QString::null); + calc_display->setStatusText(2, TQString::null); } adjustSize(); setFixedSize(sizeHint()); @@ -2022,7 +2022,7 @@ void KCalculator::slotLogicshow(bool toggled) BaseChooseGroup->hide(); if(statusBar()->hasItem(1)) statusBar()->removeItem(1); - calc_display->setStatusText(1, QString::null); + calc_display->setStatusText(1, TQString::null); for (int i=10; i<16; i++) (NumButtonGroup->find(i))->hide(); } @@ -2094,17 +2094,17 @@ void KCalculator::updateSettings() set_colors(); set_precision(); // Show the result in the app's caption in taskbar (wishlist - bug #52858) - disconnect(calc_display, SIGNAL(changedText(const QString &)), + disconnect(calc_display, TQT_SIGNAL(changedText(const TQString &)), this, 0); if (KCalcSettings::captionResult()) { connect(calc_display, - SIGNAL(changedText(const QString &)), - SLOT(setCaption(const QString &))); + TQT_SIGNAL(changedText(const TQString &)), + TQT_SLOT(setCaption(const TQString &))); } else { - setCaption(QString::null); + setCaption(TQString::null); } calc_display->changeSettings(); @@ -2136,44 +2136,44 @@ void KCalculator::UpdateDisplay(bool get_amount_from_core, void KCalculator::set_colors() { - QPushButton *p = NULL; + TQPushButton *p = NULL; calc_display->changeSettings(); - QColor bg = palette().active().background(); + TQColor bg = palette().active().background(); - QPalette numPal(KCalcSettings::numberButtonsColor(), bg); + TQPalette numPal(KCalcSettings::numberButtonsColor(), bg); for(int i=0; i<10; i++) { (NumButtonGroup->find(i))->setPalette(numPal); } - QPalette funcPal(KCalcSettings::functionButtonsColor(), bg); + TQPalette funcPal(KCalcSettings::functionButtonsColor(), bg); for(p = mFunctionButtonList.first(); p; p=mFunctionButtonList.next()) { p->setPalette(funcPal); } - QPalette statPal(KCalcSettings::statButtonsColor(), bg); + TQPalette statPal(KCalcSettings::statButtonsColor(), bg); for(p = mStatButtonList.first(); p; p=mStatButtonList.next()) { p->setPalette(statPal); } - QPalette hexPal(KCalcSettings::hexButtonsColor(), bg); + TQPalette hexPal(KCalcSettings::hexButtonsColor(), bg); for(int i=10; i<16; i++) { (NumButtonGroup->find(i))->setPalette(hexPal); } - QPalette memPal(KCalcSettings::memoryButtonsColor(), bg); + TQPalette memPal(KCalcSettings::memoryButtonsColor(), bg); for(p = mMemButtonList.first(); p; p=mMemButtonList.next()) { p->setPalette(memPal); } - QPalette opPal(KCalcSettings::operationButtonsColor(), bg); + TQPalette opPal(KCalcSettings::operationButtonsColor(), bg); for(p = mOperationButtonList.first(); p; p=mOperationButtonList.next()) { @@ -2187,33 +2187,33 @@ void KCalculator::set_precision() UpdateDisplay(false); } -bool KCalculator::eventFilter(QObject *o, QEvent *e) +bool KCalculator::eventFilter(TQObject *o, TQEvent *e) { - if(e->type() == QEvent::DragEnter) + if(e->type() == TQEvent::DragEnter) { - QDragEnterEvent *ev = (QDragEnterEvent *)e; + TQDragEnterEvent *ev = (TQDragEnterEvent *)e; ev->accept(KColorDrag::canDecode(ev)); return true; } - else if(e->type() == QEvent::DragLeave) + else if(e->type() == TQEvent::DragLeave) { return true; } - else if(e->type() == QEvent::Drop) + else if(e->type() == TQEvent::Drop) { if(!o->isA("KCalcButton")) return false; - QColor c; - QDropEvent *ev = (QDropEvent *)e; + TQColor c; + TQDropEvent *ev = (TQDropEvent *)e; if( KColorDrag::decode(ev, c)) { - QPtrList<KCalcButton> *list; + TQPtrList<KCalcButton> *list; int num_but; if((num_but = NumButtonGroup->id((KCalcButton*)o)) != -1) { - QPalette pal(c, palette().active().background()); + TQPalette pal(c, palette().active().background()); // Was it hex-button or normal digit?? if (num_but <10) @@ -2244,7 +2244,7 @@ bool KCalculator::eventFilter(QObject *o, QEvent *e) else return false; - QPalette pal(c, palette().active().background()); + TQPalette pal(c, palette().active().background()); for(KCalcButton *p = list->first(); p; p=list->next()) p->setPalette(pal); @@ -2296,7 +2296,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[]) KCalculator *calc = new KCalculator; app.setTopWidget(calc); - calc->setCaption(QString::null); + calc->setCaption(TQString::null); calc->show(); int exitCode = app.exec(); diff --git a/kcalc/kcalc.h b/kcalc/kcalc.h index 0ede211..442937d 100644 --- a/kcalc/kcalc.h +++ b/kcalc/kcalc.h @@ -63,7 +63,7 @@ class KCalculator : public KMainWindow Q_OBJECT public: - KCalculator(QWidget *parent = 0, const char *name = 0); + KCalculator(TQWidget *parent = 0, const char *name = 0); ~KCalculator(); signals: @@ -72,17 +72,17 @@ signals: void switchShowAccels(bool); private: - virtual bool eventFilter( QObject *o, QEvent *e ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); void updateGeometry(); void setupMainActions(void); void setupStatusbar(void); - QWidget *setupNumericKeys(QWidget *parent); - void setupLogicKeys(QWidget *parent); - void setupScientificKeys(QWidget *parent); - void setupStatisticKeys(QWidget *parent); - void setupConstantsKeys(QWidget *parent); - void keyPressEvent(QKeyEvent *e); - void keyReleaseEvent(QKeyEvent *e); + TQWidget *setupNumericKeys(TQWidget *parent); + void setupLogicKeys(TQWidget *parent); + void setupScientificKeys(TQWidget *parent); + void setupStatisticKeys(TQWidget *parent); + void setupConstantsKeys(TQWidget *parent); + void keyPressEvent(TQKeyEvent *e); + void keyReleaseEvent(TQKeyEvent *e); void set_precision(); void set_style(); void resetBase(void) { (BaseChooseGroup->find(1))->animateClick();}; @@ -172,16 +172,16 @@ private: private: - QWidget *mSmallPage; - QWidget *mLargePage; - QWidget *mNumericPage; + TQWidget *mSmallPage; + TQWidget *mLargePage; + TQWidget *mNumericPage; DispLogic* calc_display; // for historic reasons in "dlabel.h" - QRadioButton* pbBaseChoose[4]; - QPushButton* pbAngleChoose; - QDict<KCalcButton> pbStat; - QDict<KCalcButton> pbScientific; - QDict<KCalcButton> pbLogic; + TQRadioButton* pbBaseChoose[4]; + TQPushButton* pbAngleChoose; + TQDict<KCalcButton> pbStat; + TQDict<KCalcButton> pbScientific; + TQDict<KCalcButton> pbLogic; KCalcConstButton* pbConstant[10]; KCalcButton* pbAC; KCalcButton* pbAND; @@ -215,21 +215,21 @@ private: // buttons would like to remove this, but // don't know how - QHButtonGroup* BaseChooseGroup; + TQHButtonGroup* BaseChooseGroup; // NumButtonGroup: 0-9 = digits, 0xA-0xF = hex-keys - QButtonGroup* NumButtonGroup; + TQButtonGroup* NumButtonGroup; // ConstButtonGroup C1-C6 - QButtonGroup* ConstButtonGroup; + TQButtonGroup* ConstButtonGroup; KToggleAction *actionStatshow; KToggleAction *actionScientificshow; KToggleAction *actionLogicshow; KToggleAction *actionConstantsShow; - QPtrList<KCalcButton> mFunctionButtonList; - QPtrList<KCalcButton> mStatButtonList; - QPtrList<KCalcButton> mMemButtonList; - QPtrList<KCalcButton> mOperationButtonList; + TQPtrList<KCalcButton> mFunctionButtonList; + TQPtrList<KCalcButton> mStatButtonList; + TQPtrList<KCalcButton> mMemButtonList; + TQPtrList<KCalcButton> mOperationButtonList; int mInternalSpacing; diff --git a/kcalc/kcalc_button.cpp b/kcalc/kcalc_button.cpp index 7021a1a..7472f92 100644 --- a/kcalc/kcalc_button.cpp +++ b/kcalc/kcalc_button.cpp @@ -20,32 +20,32 @@ */ -#include <qsimplerichtext.h> -#include <qtooltip.h> -#include <qpainter.h> +#include <tqsimplerichtext.h> +#include <tqtooltip.h> +#include <tqpainter.h> -#include "qdom.h" +#include "tqdom.h" #include "kcalc_button.h" -KCalcButton::KCalcButton(QWidget * parent, const char * name) +KCalcButton::KCalcButton(TQWidget * parent, const char * name) : KPushButton(parent, name), _show_accel_mode(false), _mode_flags(ModeNormal) { setAutoDefault(false); } -KCalcButton::KCalcButton(const QString &label, QWidget * parent, - const char * name, const QString &tooltip) +KCalcButton::KCalcButton(const TQString &label, TQWidget * parent, + const char * name, const TQString &tooltip) : KPushButton(label, parent, name), _show_accel_mode(false), _mode_flags(ModeNormal) { setAutoDefault(false); addMode(ModeNormal, label, tooltip); } -void KCalcButton::addMode(ButtonModeFlags mode, QString label, QString tooltip, bool is_label_richtext) +void KCalcButton::addMode(ButtonModeFlags mode, TQString label, TQString tooltip, bool is_label_richtext) { if (_mode.contains(mode)) _mode.remove(mode); @@ -69,14 +69,14 @@ void KCalcButton::slotSetMode(ButtonModeFlags mode, bool flag) if (_mode.contains(new_mode)) { // save accel, because setting label erases accel - QKeySequence _accel = accel(); + TQKeySequence _accel = accel(); if(_mode[new_mode].is_label_richtext) _label = _mode[new_mode].label; else setText(_mode[new_mode].label); - QToolTip::remove(this); - QToolTip::add(this, _mode[new_mode].tooltip); + TQToolTip::remove(this); + TQToolTip::add(this, _mode[new_mode].tooltip); _mode_flags = new_mode; // restore accel @@ -90,7 +90,7 @@ void KCalcButton::slotSetMode(ButtonModeFlags mode, bool flag) update(); } -static QString escape(QString str) +static TQString escape(TQString str) { str.replace('&', "&&"); return str; @@ -102,10 +102,10 @@ void KCalcButton::slotSetAccelDisplayMode(bool flag) _show_accel_mode = flag; // save accel, because setting label erases accel - QKeySequence _accel = accel(); + TQKeySequence _accel = accel(); if (flag == true) { - setText(escape(QString(accel()))); + setText(escape(TQString(accel()))); } else { setText(_mode[_mode_flags].label); } @@ -114,17 +114,17 @@ void KCalcButton::slotSetAccelDisplayMode(bool flag) setAccel(_accel); } -void KCalcButton::paintLabel(QPainter *paint) +void KCalcButton::paintLabel(TQPainter *paint) { if (_mode[_mode_flags].is_label_richtext) { - QSimpleRichText _text(_label, font()); + TQSimpleRichText _text(_label, font()); _text.draw(paint, width()/2-_text.width()/2, 0, childrenRegion(), colorGroup()); } else { KPushButton::drawButtonLabel(paint); } } -void KCalcButton::drawButtonLabel(QPainter *paint) +void KCalcButton::drawButtonLabel(TQPainter *paint) { if (_show_accel_mode) { KPushButton::drawButtonLabel(paint); @@ -134,7 +134,7 @@ void KCalcButton::drawButtonLabel(QPainter *paint) } -void KSquareButton::paintLabel(QPainter *paint) +void KSquareButton::paintLabel(TQPainter *paint) { int w = width(); int w2 = w/2 - 13; @@ -155,7 +155,7 @@ void KSquareButton::paintLabel(QPainter *paint) } } -void KSquareButton::drawButtonLabel(QPainter *paint) +void KSquareButton::drawButtonLabel(TQPainter *paint) { if (_show_accel_mode) { KPushButton::drawButtonLabel(paint); diff --git a/kcalc/kcalc_button.h b/kcalc/kcalc_button.h index 0998b5f..6f103a3 100644 --- a/kcalc/kcalc_button.h +++ b/kcalc/kcalc_button.h @@ -43,7 +43,7 @@ class ButtonMode { public: ButtonMode(void) {}; - ButtonMode(QString &label, QString &tooltip, bool is_label_richtext) + ButtonMode(TQString &label, TQString &tooltip, bool is_label_richtext) : is_label_richtext(is_label_richtext), tooltip(tooltip) { if (is_label_richtext) @@ -52,9 +52,9 @@ public: this->label = label; }; - QString label; + TQString label; bool is_label_richtext; - QString tooltip; + TQString tooltip; }; @@ -63,27 +63,27 @@ class KCalcButton : public KPushButton Q_OBJECT public: - KCalcButton(QWidget *parent, const char * name = 0); - KCalcButton(const QString &label, QWidget *parent, const char * name = 0, - const QString &tooltip = QString()); + KCalcButton(TQWidget *parent, const char * name = 0); + KCalcButton(const TQString &label, TQWidget *parent, const char * name = 0, + const TQString &tooltip = TQString()); - void addMode(ButtonModeFlags mode, QString label, QString tooltip, bool is_label_richtext = false); + void addMode(ButtonModeFlags mode, TQString label, TQString tooltip, bool is_label_richtext = false); public slots: void slotSetMode(ButtonModeFlags mode, bool flag); void slotSetAccelDisplayMode(bool flag); protected: - virtual void drawButtonLabel(QPainter *paint); - void paintLabel(QPainter *paint); + virtual void drawButtonLabel(TQPainter *paint); + void paintLabel(TQPainter *paint); protected: bool _show_accel_mode; - QString _label; + TQString _label; ButtonModeFlags _mode_flags; - QMap<ButtonModeFlags, ButtonMode> _mode; + TQMap<ButtonModeFlags, ButtonMode> _mode; }; class KSquareButton : public KCalcButton @@ -91,15 +91,15 @@ class KSquareButton : public KCalcButton Q_OBJECT public: - KSquareButton(QWidget *parent, const char * name = 0) + KSquareButton(TQWidget *parent, const char * name = 0) : KCalcButton(parent, name) { }; - KSquareButton(const QString &label, QWidget *parent, const char * name = 0, - const QString &tooltip = QString()) + KSquareButton(const TQString &label, TQWidget *parent, const char * name = 0, + const TQString &tooltip = TQString()) : KCalcButton(label, parent, name, tooltip) { }; protected: - virtual void drawButtonLabel(QPainter *paint); - void paintLabel(QPainter *paint); + virtual void drawButtonLabel(TQPainter *paint); + void paintLabel(TQPainter *paint); }; #endif // _KCALC_BUTTON_H diff --git a/kcalc/kcalc_const_button.cpp b/kcalc/kcalc_const_button.cpp index e9c4216..071bb71 100644 --- a/kcalc/kcalc_const_button.cpp +++ b/kcalc/kcalc_const_button.cpp @@ -19,7 +19,7 @@ */ -#include <qstring.h> +#include <tqstring.h> #include <kcmenumngr.h> @@ -31,7 +31,7 @@ #include "kcalc_settings.h" -KCalcConstButton::KCalcConstButton(QWidget *parent, int but_num, const char * name) +KCalcConstButton::KCalcConstButton(TQWidget *parent, int but_num, const char * name) : KCalcButton(parent, name), _button_num(but_num) { addMode(ModeInverse, "Store", i18n("Write display data into memory")); @@ -40,8 +40,8 @@ KCalcConstButton::KCalcConstButton(QWidget *parent, int but_num, const char * na } -KCalcConstButton::KCalcConstButton(const QString &label, QWidget *parent, int but_num, - const char * name, const QString &tooltip) +KCalcConstButton::KCalcConstButton(const TQString &label, TQWidget *parent, int but_num, + const char * name, const TQString &tooltip) : KCalcButton(label, parent, name, tooltip), _button_num(but_num) { addMode(ModeInverse, "Store", i18n("Write display data into memory")); @@ -49,15 +49,15 @@ KCalcConstButton::KCalcConstButton(const QString &label, QWidget *parent, int bu initPopupMenu(); } -QString KCalcConstButton::constant(void) const +TQString KCalcConstButton::constant(void) const { return KCalcSettings::valueConstant(_button_num); } void KCalcConstButton::setLabelAndTooltip(void) { - QString new_label = QString("C") + QString().setNum(_button_num + 1); - QString new_tooltip; + TQString new_label = TQString("C") + TQString().setNum(_button_num + 1); + TQString new_tooltip; new_label = (KCalcSettings::nameConstant(_button_num).isNull() ? new_label : KCalcSettings::nameConstant(_button_num)); @@ -74,8 +74,8 @@ void KCalcConstButton::initPopupMenu(void) _popup->insertItem(i18n("Set Name"), 0); _popup->insertItem(i18n("Choose From List"), tmp_menu, 1); - connect(_popup, SIGNAL(activated(int)), SLOT(slotConfigureButton(int))); - connect(tmp_menu, SIGNAL(activated(int)), SLOT(slotChooseScientificConst(int))); + connect(_popup, TQT_SIGNAL(activated(int)), TQT_SLOT(slotConfigureButton(int))); + connect(tmp_menu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChooseScientificConst(int))); KContextMenuManager::insert(this, _popup); } @@ -85,7 +85,7 @@ void KCalcConstButton::slotConfigureButton(int option) if (option == 0) { bool yes_no; - QString input = KInputDialog::text(i18n("New Name for Constant"), i18n("New name:"), + TQString input = KInputDialog::text(i18n("New Name for Constant"), i18n("New name:"), text(), &yes_no, this, "nameUserConstants-Dialog"); if(yes_no) { KCalcSettings::setNameConstant(_button_num, input); diff --git a/kcalc/kcalc_const_button.h b/kcalc/kcalc_const_button.h index 18ebf3e..110df3c 100644 --- a/kcalc/kcalc_const_button.h +++ b/kcalc/kcalc_const_button.h @@ -34,12 +34,12 @@ Q_OBJECT public: - KCalcConstButton(QWidget *parent, int but_num, const char * name = 0); + KCalcConstButton(TQWidget *parent, int but_num, const char * name = 0); - KCalcConstButton(const QString &label, QWidget *parent, int but_num, const char * name = 0, - const QString &tooltip = QString()); + KCalcConstButton(const TQString &label, TQWidget *parent, int but_num, const char * name = 0, + const TQString &tooltip = TQString()); - QString constant(void) const; + TQString constant(void) const; void setLabelAndTooltip(void); diff --git a/kcalc/kcalc_const_menu.cpp b/kcalc/kcalc_const_menu.cpp index 77bb02e..f758c9f 100644 --- a/kcalc/kcalc_const_menu.cpp +++ b/kcalc/kcalc_const_menu.cpp @@ -26,37 +26,37 @@ #define NUM_CONST 17 const struct science_constant KCalcConstMenu::Constants[] = { - {QString::fromUtf8("π"), I18N_NOOP("Pi"), "", + {TQString::fromUtf8("π"), I18N_NOOP("Pi"), "", "3.1415926535897932384626433832795028841971693993751" "05820974944592307816406286208998628034825342117068", Mathematics}, {"e", I18N_NOOP("Euler Number"), "", "2.7182818284590452353602874713526624977572470936999" "59574966967627724076630353547594571382178525166427", Mathematics}, - {QString::fromUtf8("φ"), I18N_NOOP("Golden Ratio"), "", "1.61803398874989484820458683436563811", Mathematics}, + {TQString::fromUtf8("φ"), I18N_NOOP("Golden Ratio"), "", "1.61803398874989484820458683436563811", Mathematics}, {"c", I18N_NOOP("Light Speed"), "", "2.99792458e8", Electromagnetic}, {"h", I18N_NOOP("Planck's Constant"), "", "6.6260693e-34", Nuclear}, {"G", I18N_NOOP("Constant of Gravitation"), "", "6.6742e-11", Gravitation}, {"g", I18N_NOOP("Earth Acceleration"), "", "9.80665", Gravitation}, {"e", I18N_NOOP("Elementary Charge"), "", "1.60217653e-19", ConstantCategory(Electromagnetic|Nuclear)}, {"Z_0", I18N_NOOP("Impedance of Vacuum"), "", "376.730313461", Electromagnetic}, - {QString::fromUtf8("α"), I18N_NOOP("Fine-Structure Constant"), "", "7.297352568e-3", Nuclear}, - {QString::fromUtf8("μ")+"_0", I18N_NOOP("Permeability of Vacuum"), "", "1.2566370614e-6", Electromagnetic}, - {QString::fromUtf8("ε")+"_0", I18N_NOOP("Permittivity of vacuum"), "", "8.854187817e-12", Electromagnetic}, + {TQString::fromUtf8("α"), I18N_NOOP("Fine-Structure Constant"), "", "7.297352568e-3", Nuclear}, + {TQString::fromUtf8("μ")+"_0", I18N_NOOP("Permeability of Vacuum"), "", "1.2566370614e-6", Electromagnetic}, + {TQString::fromUtf8("ε")+"_0", I18N_NOOP("Permittivity of vacuum"), "", "8.854187817e-12", Electromagnetic}, {"k", I18N_NOOP("Boltzmann Constant"), "", "1.3806505e-23", Thermodynamics}, {"1u", I18N_NOOP("Atomic Mass Unit"), "", "1.66053886e-27", Thermodynamics}, {"R", I18N_NOOP("Molar Gas Constant"), "", "8.314472", Thermodynamics}, - {QString::fromUtf8("σ"), I18N_NOOP("Stefan-Boltzmann Constant"), "", "5.670400e-8", Thermodynamics}, + {TQString::fromUtf8("σ"), I18N_NOOP("Stefan-Boltzmann Constant"), "", "5.670400e-8", Thermodynamics}, {"N_A", I18N_NOOP("Avogadro's Number"), "", "6.0221415e23", Thermodynamics} }; -KCalcConstMenu::KCalcConstMenu(QWidget * parent, const char * name) - : QPopupMenu(parent, name) +KCalcConstMenu::KCalcConstMenu(TQWidget * parent, const char * name) + : TQPopupMenu(parent, name) { - QPopupMenu *math_menu = new QPopupMenu(this, "mathematical constants"); - QPopupMenu *em_menu = new QPopupMenu(this, "electromagnetic constants"); - QPopupMenu *nuclear_menu = new QPopupMenu(this, "nuclear constants"); - QPopupMenu *thermo_menu = new QPopupMenu(this, "thermodynamics constants"); - QPopupMenu *gravitation_menu = new QPopupMenu(this, "gravitation constants"); + TQPopupMenu *math_menu = new TQPopupMenu(this, "mathematical constants"); + TQPopupMenu *em_menu = new TQPopupMenu(this, "electromagnetic constants"); + TQPopupMenu *nuclear_menu = new TQPopupMenu(this, "nuclear constants"); + TQPopupMenu *thermo_menu = new TQPopupMenu(this, "thermodynamics constants"); + TQPopupMenu *gravitation_menu = new TQPopupMenu(this, "gravitation constants"); insertItem(i18n("Mathematics"), math_menu); insertItem(i18n("Electromagnetism"), em_menu); @@ -64,11 +64,11 @@ KCalcConstMenu::KCalcConstMenu(QWidget * parent, const char * name) insertItem(i18n("Thermodynamics"), thermo_menu); insertItem(i18n("Gravitation"), gravitation_menu); - connect(math_menu, SIGNAL(activated(int)), this, SLOT(slotPassActivate(int))); - connect(em_menu, SIGNAL(activated(int)), this, SLOT(slotPassActivate(int))); - connect(nuclear_menu, SIGNAL(activated(int)), this, SLOT(slotPassActivate(int))); - connect(thermo_menu, SIGNAL(activated(int)), this, SLOT(slotPassActivate(int))); - connect(gravitation_menu, SIGNAL(activated(int)), this, SLOT(slotPassActivate(int))); + connect(math_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotPassActivate(int))); + connect(em_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotPassActivate(int))); + connect(nuclear_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotPassActivate(int))); + connect(thermo_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotPassActivate(int))); + connect(gravitation_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotPassActivate(int))); for (int i = 0; i<NUM_CONST; i++) { diff --git a/kcalc/kcalc_const_menu.h b/kcalc/kcalc_const_menu.h index 4ae8da3..94c8412 100644 --- a/kcalc/kcalc_const_menu.h +++ b/kcalc/kcalc_const_menu.h @@ -23,16 +23,16 @@ #ifndef _KCALC_CONST_MENU_H #define _KCALC_CONST_MENU_H -#include <qpopupmenu.h> -#include <qstring.h> +#include <tqpopupmenu.h> +#include <tqstring.h> enum ConstantCategory {Mathematics = 1, Electromagnetic = 2, Nuclear = 4, Thermodynamics = 8, Gravitation = 16}; struct science_constant{ - QString label; + TQString label; const char * name; - QString whatsthis; - QString value; + TQString whatsthis; + TQString value; ConstantCategory category; }; @@ -41,7 +41,7 @@ class KCalcConstMenu : public QPopupMenu Q_OBJECT public: - KCalcConstMenu(QWidget * parent = 0, const char * name = 0); + KCalcConstMenu(TQWidget * parent = 0, const char * name = 0); static const struct science_constant Constants[]; diff --git a/kcalc/kcalc_core.h b/kcalc/kcalc_core.h index edd33f3..fe818e9 100644 --- a/kcalc/kcalc_core.h +++ b/kcalc/kcalc_core.h @@ -26,7 +26,7 @@ #define _KCALC_CORE_H #include "stats.h" -#include <qvaluestack.h> +#include <tqvaluestack.h> #include "knumber.h" #define POS_ZERO 1e-19L /* What we consider zero is */ @@ -153,7 +153,7 @@ class CalcEngine // into the stack, each time the user opens one. When a bracket is // closed, everything in the stack is evaluated until the first // marker "FUNC_BRACKET" found. - QValueStack<_node> _stack; + TQValueStack<_node> _stack; KNumber _last_number; diff --git a/kcalc/kcalcdisplay.cpp b/kcalc/kcalcdisplay.cpp index 672c363..1f90e03 100644 --- a/kcalc/kcalcdisplay.cpp +++ b/kcalc/kcalcdisplay.cpp @@ -27,9 +27,9 @@ #include <stdlib.h> #include <ctype.h> -#include <qclipboard.h> -#include <qpainter.h> -#include <qregexp.h> +#include <tqclipboard.h> +#include <tqpainter.h> +#include <tqregexp.h> #include <kglobal.h> #include <klocale.h> @@ -39,22 +39,22 @@ #include "kcalcdisplay.moc" -KCalcDisplay::KCalcDisplay(QWidget *parent, const char *name) - :QLabel(parent,name), _beep(false), _groupdigits(false), _button(0), _lit(false), +KCalcDisplay::KCalcDisplay(TQWidget *parent, const char *name) + :TQLabel(parent,name), _beep(false), _groupdigits(false), _button(0), _lit(false), _num_base(NB_DECIMAL), _precision(9), _fixed_precision(-1), _display_amount(0), - selection_timer(new QTimer) + selection_timer(new TQTimer) { - setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); setAlignment(AlignRight | AlignVCenter); setFocus(); - setFocusPolicy(QWidget::StrongFocus); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed, false); + setFocusPolicy(TQWidget::StrongFocus); + setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed, false); - connect(this, SIGNAL(clicked()), this, SLOT(slotDisplaySelected())); + connect(this, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDisplaySelected())); - connect(selection_timer, SIGNAL(timeout()), - this, SLOT(slotSelectionTimedOut())); + connect(selection_timer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(slotSelectionTimedOut())); sendEvent(EventReset); } @@ -71,7 +71,7 @@ bool KCalcDisplay::sendEvent(Event const event) case EventReset: _display_amount = 0; _str_int = "0"; - _str_int_exp = QString::null; + _str_int_exp = TQString::null; _eestate = false; _period = false; @@ -102,16 +102,16 @@ void KCalcDisplay::slotCut(void) void KCalcDisplay::slotCopy(void) { - QString txt = QLabel::text(); + TQString txt = TQLabel::text(); if (_num_base == NB_HEX) txt.prepend( "0x" ); - (QApplication::clipboard())->setText(txt, QClipboard::Clipboard); - (QApplication::clipboard())->setText(txt, QClipboard::Selection); + (TQApplication::clipboard())->setText(txt, QClipboard::Clipboard); + (TQApplication::clipboard())->setText(txt, QClipboard::Selection); } void KCalcDisplay::slotPaste(bool bClipboard) { - QString tmp_str = (QApplication::clipboard())->text(bClipboard ? QClipboard::Clipboard : QClipboard::Selection); + TQString tmp_str = (TQApplication::clipboard())->text(bClipboard ? QClipboard::Clipboard : QClipboard::Selection); if (tmp_str.isNull()) { @@ -173,14 +173,14 @@ void KCalcDisplay::slotSelectionTimedOut(void) void KCalcDisplay::invertColors() { - QColor tmp_col(paletteBackgroundColor()); + TQColor tmp_col(paletteBackgroundColor()); setPaletteBackgroundColor(paletteForegroundColor()); setPaletteForegroundColor(tmp_col); } -void KCalcDisplay::mousePressEvent(QMouseEvent *e) +void KCalcDisplay::mousePressEvent(TQMouseEvent *e) { if(e->button() == LeftButton) { _lit = !_lit; @@ -223,10 +223,10 @@ KNumber const & KCalcDisplay::getAmount(void) const bool KCalcDisplay::setAmount(KNumber const & new_amount) { - QString display_str; + TQString display_str; _str_int = "0"; - _str_int_exp = QString::null; + _str_int_exp = TQString::null; _period = false; _neg_sign = false; _eestate = false; @@ -236,7 +236,7 @@ bool KCalcDisplay::setAmount(KNumber const & new_amount) _display_amount = new_amount.integerPart(); unsigned long long int tmp_workaround = static_cast<unsigned long long int>(_display_amount); - display_str = QString::number(tmp_workaround, _num_base).upper(); + display_str = TQString::number(tmp_workaround, _num_base).upper(); } else // _num_base == NB_DECIMAL || new_amount.type() == // KNumber::SpecialType @@ -246,9 +246,9 @@ bool KCalcDisplay::setAmount(KNumber const & new_amount) display_str = _display_amount.toQString(KCalcSettings::precision(), _fixed_precision); #if 0 else if (_display_amount > 1.0e+16) - display_str = QCString().sprintf(PRINT_LONG_BIG, _precision + 1, _display_amount); + display_str = TQCString().sprintf(PRINT_LONG_BIG, _precision + 1, _display_amount); else - display_str = QCString().sprintf(PRINT_LONG_BIG, _precision, _display_amount); + display_str = TQCString().sprintf(PRINT_LONG_BIG, _precision, _display_amount); #endif } @@ -257,9 +257,9 @@ bool KCalcDisplay::setAmount(KNumber const & new_amount) } -void KCalcDisplay::setText(QString const &string) +void KCalcDisplay::setText(TQString const &string) { - QString localizedString = string; + TQString localizedString = string; // If we aren't in decimal mode, we don't need to modify the string if (_num_base == NB_DECIMAL && _groupdigits) @@ -273,18 +273,18 @@ void KCalcDisplay::setText(QString const &string) } else localizedString = KGlobal::locale()->formatNumber(string, false, 0); // Note: rounding happened already above! - QLabel::setText(localizedString); + TQLabel::setText(localizedString); emit changedText(localizedString); } -QString KCalcDisplay::text() const +TQString KCalcDisplay::text() const { if (_num_base != NB_DECIMAL) - return QLabel::text(); - QString display_str = _display_amount.toQString(KCalcSettings::precision()); + return TQLabel::text(); + TQString display_str = _display_amount.toQString(KCalcSettings::precision()); return display_str; - // return QCString().sprintf(PRINT_LONG_BIG, 40, _display_amount); + // return TQCString().sprintf(PRINT_LONG_BIG, 40, _display_amount); } /* change representation of display to new base (i.e. binary, decimal, @@ -321,7 +321,7 @@ int KCalcDisplay::setBase(NumBase new_base) return _num_base; } -void KCalcDisplay::setStatusText(uint i, const QString& text) +void KCalcDisplay::setStatusText(uint i, const TQString& text) { if (i < NUM_STATUS_TEXT) _str_status[i] = text; @@ -331,7 +331,7 @@ void KCalcDisplay::setStatusText(uint i, const QString& text) bool KCalcDisplay::updateDisplay(void) { // Put sign in front. - QString tmp_string; + TQString tmp_string; if(_neg_sign == true) tmp_string = "-" + _str_int; else @@ -577,16 +577,16 @@ bool KCalcDisplay::changeSign(void) return true; } -void KCalcDisplay::drawContents(QPainter *p) +void KCalcDisplay::drawContents(TQPainter *p) { - QLabel::drawContents(p); + TQLabel::drawContents(p); // draw the status texts using half of the normal // font size but not smaller than 7pt - QFont f(font()); + TQFont f(font()); f.setPointSize(QMAX((f.pointSize() / 2), 7)); p->setFont(f); - QFontMetrics fm(f); + TQFontMetrics fm(f); uint w = fm.width("_____"); uint h = fm.height(); @@ -598,11 +598,11 @@ void KCalcDisplay::drawContents(QPainter *p) // Return the QLabel's normal size hint vertically expanded // by half the font height to make room for the status texts -QSize KCalcDisplay::sizeHint() const +TQSize KCalcDisplay::sizeHint() const { - QFont f(font()); + TQFont f(font()); f.setPointSize(QMAX((f.pointSize() / 2), 7)); - QFontMetrics fm(f); - return QLabel::sizeHint() + QSize(0, fm.height()); + TQFontMetrics fm(f); + return TQLabel::sizeHint() + TQSize(0, fm.height()); } diff --git a/kcalc/kcalcdisplay.h b/kcalc/kcalcdisplay.h index 4f72fb7..6f7233c 100644 --- a/kcalc/kcalcdisplay.h +++ b/kcalc/kcalcdisplay.h @@ -27,8 +27,8 @@ #define _D_KCALCDISPLAY_H_ #include <stdlib.h> -#include <qlabel.h> -#include <qtimer.h> +#include <tqlabel.h> +#include <tqtimer.h> #include "knumber.h" #include "kcalctype.h" @@ -81,12 +81,12 @@ class KCalcDisplay : public QLabel Q_OBJECT public: - KCalcDisplay(QWidget *parent=0, const char *name=0); + KCalcDisplay(TQWidget *parent=0, const char *name=0); ~KCalcDisplay(); protected: - void mousePressEvent ( QMouseEvent *); - virtual void drawContents(QPainter *p); + void mousePressEvent ( TQMouseEvent *); + virtual void drawContents(TQPainter *p); public: enum Event { @@ -105,11 +105,11 @@ public: void setGroupDigits(bool flag); void setFixedPrecision(int precision); void setPrecision(int precision); - void setText(QString const &string); - QString text() const; + void setText(TQString const &string); + TQString text() const; bool updateDisplay(void); - void setStatusText(uint i, const QString& text); - virtual QSize sizeHint() const; + void setStatusText(uint i, const TQString& text); + virtual TQSize sizeHint() const; private: bool _beep; bool _groupdigits; @@ -129,15 +129,15 @@ private: bool _eestate; bool _period; bool _neg_sign; - QString _str_int; - QString _str_int_exp; - QString _str_status[NUM_STATUS_TEXT]; + TQString _str_int; + TQString _str_int_exp; + TQString _str_status[NUM_STATUS_TEXT]; - QTimer* selection_timer; + TQTimer* selection_timer; signals: void clicked(void); - void changedText(QString const &); + void changedText(TQString const &); public slots: void slotCut(void); diff --git a/kcalc/knumber/knumber.cpp b/kcalc/knumber/knumber.cpp index d282b26..80bae1f 100644 --- a/kcalc/knumber/knumber.cpp +++ b/kcalc/knumber/knumber.cpp @@ -22,8 +22,8 @@ #include <config.h> -#include <qregexp.h> -#include <qstring.h> +#include <tqregexp.h> +#include <tqstring.h> #include "knumber.h" @@ -94,17 +94,17 @@ KNumber::KNumber(KNumber const & num) } -KNumber::KNumber(QString const & num) +KNumber::KNumber(TQString const & num) { - if (QRegExp("^(inf|-inf|nan)$").exactMatch(num)) + if (TQRegExp("^(inf|-inf|nan)$").exactMatch(num)) _num = new _knumerror(num); - else if (QRegExp("^[+-]?\\d+$").exactMatch(num)) + else if (TQRegExp("^[+-]?\\d+$").exactMatch(num)) _num = new _knuminteger(num); - else if (QRegExp("^[+-]?\\d+/\\d+$").exactMatch(num)) { + else if (TQRegExp("^[+-]?\\d+/\\d+$").exactMatch(num)) { _num = new _knumfraction(num); simplifyRational(); } - else if (QRegExp("^[+-]?\\d+(\\.\\d*)?(e[+-]?\\d+)?$").exactMatch(num)) + else if (TQRegExp("^[+-]?\\d+(\\.\\d*)?(e[+-]?\\d+)?$").exactMatch(num)) if (_fraction_input == true) { _num = new _knumfraction(num); simplifyRational(); @@ -228,7 +228,7 @@ KNumber & KNumber::operator -=(KNumber const &arg) } // increase the digit at 'position' by one -static void _inc_by_one(QString &str, int position) +static void _inc_by_one(TQString &str, int position) { for (int i = position; i >= 0; i--) { @@ -274,7 +274,7 @@ static void _inc_by_one(QString &str, int position) } // Cut off if more digits in fractional part than 'precision' -static void _round(QString &str, int precision) +static void _round(TQString &str, int precision) { int decimalSymbolPos = str.find('.'); @@ -287,7 +287,7 @@ static void _round(QString &str, int precision) } // fill up with more than enough zeroes (in case fractional part too short) - str.append(QString().fill('0', precision)); + str.append(TQString().fill('0', precision)); // Now decide whether to round up or down char last_char = str[decimalSymbolPos + precision + 1].latin1(); @@ -319,11 +319,11 @@ static void _round(QString &str, int precision) if (precision == 0) str = str.section('.', 0, 0); } -static QString roundNumber(const QString &numStr, int precision) +static TQString roundNumber(const TQString &numStr, int precision) { - QString tmpString = numStr; + TQString tmpString = numStr; if (precision < 0 || - ! QRegExp("^[+-]?\\d+(\\.\\d+)*(e[+-]?\\d+)?$").exactMatch(tmpString)) + ! TQRegExp("^[+-]?\\d+(\\.\\d+)*(e[+-]?\\d+)?$").exactMatch(tmpString)) return numStr; @@ -333,12 +333,12 @@ static QString roundNumber(const QString &numStr, int precision) // Split off exponential part (including 'e'-symbol) - QString mantString = tmpString.section('e', 0, 0, - QString::SectionCaseInsensitiveSeps); - QString expString = tmpString.section('e', 1, 1, - QString::SectionCaseInsensitiveSeps | - QString::SectionIncludeLeadingSep); - if (expString.length() == 1) expString = QString(); + TQString mantString = tmpString.section('e', 0, 0, + TQString::SectionCaseInsensitiveSeps); + TQString expString = tmpString.section('e', 1, 1, + TQString::SectionCaseInsensitiveSeps | + TQString::SectionIncludeLeadingSep); + if (expString.length() == 1) expString = TQString(); _round(mantString, precision); @@ -349,9 +349,9 @@ static QString roundNumber(const QString &numStr, int precision) } -QString const KNumber::toQString(int width, int prec) const +TQString const KNumber::toQString(int width, int prec) const { - QString tmp_str; + TQString tmp_str; if (*this == Zero) // important to avoid infinite loops below return "0"; @@ -363,7 +363,7 @@ QString const KNumber::toQString(int width, int prec) const tmp_str = (KNumber("1.0")*(*this)).toQString(width, -1); _fraction_input = tmp_bool; } else - tmp_str = QString(_num->ascii()); + tmp_str = TQString(_num->ascii()); break; case FractionType: if (_float_output) { @@ -376,13 +376,13 @@ QString const KNumber::toQString(int width, int prec) const // split off integer part KNumber int_part = this->integerPart(); if (int_part == Zero) - tmp_str = QString(_num->ascii()); + tmp_str = TQString(_num->ascii()); else if (int_part < Zero) tmp_str = int_part.toQString() + " " + (int_part - *this)._num->ascii(); else tmp_str = int_part.toQString() + " " + (*this - int_part)._num->ascii(); } else - tmp_str = QString(_num->ascii()); + tmp_str = TQString(_num->ascii()); if (width > 0 && tmp_str.length() > width) { //result needs to be cut-off @@ -396,13 +396,13 @@ QString const KNumber::toQString(int width, int prec) const break; case FloatType: if (width > 0) - tmp_str = QString(_num->ascii(width)); + tmp_str = TQString(_num->ascii(width)); else // rough estimate for maximal decimal precision (10^3 = 2^10) - tmp_str = QString(_num->ascii(3*mpf_get_default_prec()/10)); + tmp_str = TQString(_num->ascii(3*mpf_get_default_prec()/10)); break; default: - return QString(_num->ascii()); + return TQString(_num->ascii()); } if (prec >= 0) diff --git a/kcalc/knumber/knumber.h b/kcalc/knumber/knumber.h index 489a579..b0b4444 100644 --- a/kcalc/knumber/knumber.h +++ b/kcalc/knumber/knumber.h @@ -115,7 +115,7 @@ class KDE_EXPORT KNumber KNumber(KNumber const & num); - KNumber(QString const & num); + KNumber(TQString const & num); ~KNumber() { @@ -142,7 +142,7 @@ class KDE_EXPORT KNumber static void setDefaultFloatOutput(bool flag); /** - * Set whether a number constructed from a QString should be + * Set whether a number constructed from a TQString should be * initialized as a fraction or as a float, e.g. "1.01" would be * treated as 101/100, if this flag is set to true. * @@ -168,7 +168,7 @@ class KDE_EXPORT KNumber static void setSplitoffIntegerForFractionOutput(bool flag); /** - * Return a QString representing the KNumber. + * Return a TQString representing the KNumber. * * @param width This number specifies the maximal length of the * output, before the method switches to exponential notation and @@ -179,7 +179,7 @@ class KDE_EXPORT KNumber * is ignored. * */ - QString const toQString(int width = -1, int prec = -1) const; + TQString const toQString(int width = -1, int prec = -1) const; /** * Compute the absolute value, i.e. @p x.abs() returns the value diff --git a/kcalc/knumber/knumber_priv.cpp b/kcalc/knumber/knumber_priv.cpp index 1326d44..56de7d3 100644 --- a/kcalc/knumber/knumber_priv.cpp +++ b/kcalc/knumber/knumber_priv.cpp @@ -23,8 +23,8 @@ #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif -#include <qregexp.h> -#include <qstring.h> +#include <tqregexp.h> +#include <tqstring.h> #include "knumber_priv.h" @@ -115,7 +115,7 @@ _knumfloat::_knumfloat(_knumber const & num) -_knumerror::_knumerror(QString const & num) +_knumerror::_knumerror(TQString const & num) { if (num == "nan") _error = UndefinedNumber; @@ -125,20 +125,20 @@ _knumerror::_knumerror(QString const & num) _error = MinusInfinity; } -_knuminteger::_knuminteger(QString const & num) +_knuminteger::_knuminteger(TQString const & num) { mpz_init(_mpz); mpz_set_str(_mpz, num.ascii(), 10); } -_knumfraction::_knumfraction(QString const & num) +_knumfraction::_knumfraction(TQString const & num) { mpq_init(_mpq); - if (QRegExp("^[+-]?\\d+(\\.\\d*)?(e[+-]?\\d+)?$").exactMatch(num)) { + if (TQRegExp("^[+-]?\\d+(\\.\\d*)?(e[+-]?\\d+)?$").exactMatch(num)) { // my hand-made conversion is terrible // first me convert the mantissa unsigned long int digits_after_dot = ((num.section( '.', 1, 1)).section('e', 0, 0)).length(); - QString tmp_num = num.section('e', 0, 0).remove('.'); + TQString tmp_num = num.section('e', 0, 0).remove('.'); mpq_set_str(_mpq, tmp_num.ascii(), 10); mpz_t tmp_int; mpz_init(tmp_int); @@ -163,7 +163,7 @@ _knumfraction::_knumfraction(QString const & num) mpq_canonicalize(_mpq); } -_knumfloat::_knumfloat(QString const & num) +_knumfloat::_knumfloat(TQString const & num) { mpf_init(_mpf); mpf_set_str(_mpf, num.ascii(), 10); @@ -178,51 +178,51 @@ _knuminteger const & _knuminteger::operator = (_knuminteger const & num) return *this; } -QString const _knumerror::ascii(int prec) const +TQString const _knumerror::ascii(int prec) const { static_cast<void>(prec); switch(_error) { case UndefinedNumber: - return QString("nan"); + return TQString("nan"); case Infinity: - return QString("inf"); + return TQString("inf"); case MinusInfinity: - return QString("-inf"); + return TQString("-inf"); default: - return QString::null; + return TQString::null; } } -QString const _knuminteger::ascii(int prec) const +TQString const _knuminteger::ascii(int prec) const { static_cast<void>(prec); char *tmp_ptr; gmp_asprintf(&tmp_ptr, "%Zd", _mpz); - QString ret_str = tmp_ptr; + TQString ret_str = tmp_ptr; free(tmp_ptr); return ret_str; } -QString const _knumfraction::ascii(int prec) const +TQString const _knumfraction::ascii(int prec) const { static_cast<void>(prec); char *tmp_ptr = mpq_get_str(0, 10, _mpq); - QString ret_str = tmp_ptr; + TQString ret_str = tmp_ptr; free(tmp_ptr); return ret_str; } -QString const _knumfloat::ascii(int prec) const +TQString const _knumfloat::ascii(int prec) const { - QString ret_str; + TQString ret_str; char *tmp_ptr; if (prec > 0) - gmp_asprintf(&tmp_ptr, ("%." + QString().setNum(prec) + "Fg").ascii(), _mpf); + gmp_asprintf(&tmp_ptr, ("%." + TQString().setNum(prec) + "Fg").ascii(), _mpf); else gmp_asprintf(&tmp_ptr, "%Fg", _mpf); diff --git a/kcalc/knumber/knumber_priv.h b/kcalc/knumber/knumber_priv.h index 7dd58a6..cb6b13b 100644 --- a/kcalc/knumber/knumber_priv.h +++ b/kcalc/knumber/knumber_priv.h @@ -47,7 +47,7 @@ class _knumber virtual NumType type(void) const = 0; - virtual QString const ascii(int prec = -1) const = 0; + virtual TQString const ascii(int prec = -1) const = 0; virtual _knumber * abs(void) const = 0; virtual _knumber * intPart(void) const = 0; @@ -79,7 +79,7 @@ class _knumerror : public _knumber _knumerror(_knumber const & num); - _knumerror(const QString & num); + _knumerror(const TQString & num); //virtual ~_knumerror() { } @@ -92,7 +92,7 @@ class _knumerror : public _knumber virtual NumType type(void) const {return SpecialType;} - virtual QString const ascii(int prec = -1) const; + virtual TQString const ascii(int prec = -1) const; virtual _knumber * abs(void) const; virtual _knumber * intPart(void) const; @@ -150,7 +150,7 @@ class _knuminteger : public _knumber _knuminteger(_knumber const & num); - _knuminteger(const QString & num); + _knuminteger(const TQString & num); virtual ~_knuminteger() { @@ -166,7 +166,7 @@ class _knuminteger : public _knumber virtual NumType type(void) const {return IntegerType;} - virtual QString const ascii(int prec = -1) const; + virtual TQString const ascii(int prec = -1) const; virtual _knumber * abs(void) const; virtual _knumber * intPart(void) const; @@ -213,7 +213,7 @@ class _knumfraction : public _knumber _knumfraction(_knumber const & num); - _knumfraction(QString const & num); + _knumfraction(TQString const & num); virtual ~_knumfraction() { @@ -227,7 +227,7 @@ class _knumfraction : public _knumber virtual NumType type(void) const {return FractionType;} - virtual QString const ascii(int prec = -1) const; + virtual TQString const ascii(int prec = -1) const; bool isInteger(void) const; @@ -267,7 +267,7 @@ class _knumfloat : public _knumber _knumfloat(_knumber const & num); - _knumfloat(QString const & num); + _knumfloat(TQString const & num); virtual ~_knumfloat() { @@ -281,7 +281,7 @@ class _knumfloat : public _knumber virtual NumType type(void) const {return FloatType;} - virtual QString const ascii(int prec = -1) const; + virtual TQString const ascii(int prec = -1) const; virtual _knumber * abs(void) const; virtual _knumber * intPart(void) const; diff --git a/kcalc/knumber/tests/knumbertest.cpp b/kcalc/knumber/tests/knumbertest.cpp index 814410e..e34d94d 100644 --- a/kcalc/knumber/tests/knumbertest.cpp +++ b/kcalc/knumber/tests/knumbertest.cpp @@ -6,29 +6,29 @@ #include <stdio.h> #include <iostream> -#include <qstring.h> +#include <tqstring.h> #include "knumbertest.h" -QString const numtypeToString(KNumber::NumType arg) +TQString const numtypeToString(KNumber::NumType arg) { switch(arg) { case KNumber::SpecialType: - return QString("Special"); + return TQString("Special"); case KNumber::IntegerType: - return QString("Integer"); + return TQString("Integer"); case KNumber::FractionType: - return QString("Fraction"); + return TQString("Fraction"); case KNumber::FloatType: - return QString("Float"); + return TQString("Float"); default: - return QString("Unknown:") + QString::number(static_cast<int>(arg)); + return TQString("Unknown:") + TQString::number(static_cast<int>(arg)); } } -void checkResult(QString const &string, KNumber const & result, - QString const & desired_string, KNumber::NumType desired) +void checkResult(TQString const &string, KNumber const & result, + TQString const & desired_string, KNumber::NumType desired) { std::cout << "Testing result of: " << string.ascii() << " should give " << desired_string.ascii() << " and gives " << @@ -47,7 +47,7 @@ void checkResult(QString const &string, KNumber const & result, exit(1); } -void checkTruth(QString const &string, bool computation, +void checkTruth(TQString const &string, bool computation, bool desired_result) { std::cout << "Testing truth of: " << string.ascii() << @@ -64,7 +64,7 @@ void checkTruth(QString const &string, bool computation, } -void checkType(QString const &string, KNumber::NumType test_arg, +void checkType(TQString const &string, KNumber::NumType test_arg, KNumber::NumType desired) { std::cout << "Testing type of: " << string.ascii() << " should give " << diff --git a/kcalc/stats.cpp b/kcalc/stats.cpp index 909bed6..45da5c3 100644 --- a/kcalc/stats.cpp +++ b/kcalc/stats.cpp @@ -64,7 +64,7 @@ void KStats::clearLast(void) { KNumber KStats::sum(void) { KNumber result = 0; - QValueVector<KNumber>::iterator p; + TQValueVector<KNumber>::iterator p; for(p = mData.begin(); p != mData.end(); ++p) { result += *p; @@ -94,7 +94,7 @@ KNumber KStats::median(void) { return mData.at(0); // need to copy mData-list, because sorting afterwards - QValueVector<KNumber> tmp_mData(mData); + TQValueVector<KNumber> tmp_mData(mData); qHeapSort(tmp_mData); if( bound & 1) { // odd @@ -113,7 +113,7 @@ KNumber KStats::std_kernel(void) { KNumber result = KNumber::Zero; KNumber _mean; - QValueVector<KNumber>::iterator p; + TQValueVector<KNumber>::iterator p; _mean = mean(); @@ -128,7 +128,7 @@ KNumber KStats::std_kernel(void) KNumber KStats::sum_of_squares() { KNumber result = 0; - QValueVector<KNumber>::iterator p; + TQValueVector<KNumber>::iterator p; for(p = mData.begin(); p != mData.end(); ++p) { result += ((*p) * (*p)); diff --git a/kcalc/stats.h b/kcalc/stats.h index 48b7ddc..aba11f4 100644 --- a/kcalc/stats.h +++ b/kcalc/stats.h @@ -26,7 +26,7 @@ #ifndef KSTATS_H #define KSTATS_H -#include <qvaluevector.h> +#include <tqvaluevector.h> #include "knumber.h" class KStats { @@ -50,7 +50,7 @@ public: bool error(); private: - QValueVector<KNumber> mData; + TQValueVector<KNumber> mData; bool error_flag; }; |