diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:22:56 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:22:56 +0000 |
commit | 7346aee26bf190a7e70333c40fab4caca847cd27 (patch) | |
tree | 4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /kicker-applets/math/mathapplet.cpp | |
parent | 23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff) | |
download | tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.tar.gz tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker-applets/math/mathapplet.cpp')
-rw-r--r-- | kicker-applets/math/mathapplet.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/kicker-applets/math/mathapplet.cpp b/kicker-applets/math/mathapplet.cpp index b4966b2..9d7ca38 100644 --- a/kicker-applets/math/mathapplet.cpp +++ b/kicker-applets/math/mathapplet.cpp @@ -23,11 +23,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include <qlabel.h> -#include <qfont.h> -#include <qstringlist.h> -#include <qpushbutton.h> -#include <qhbox.h> +#include <tqlabel.h> +#include <tqfont.h> +#include <tqstringlist.h> +#include <tqpushbutton.h> +#include <tqhbox.h> #include <kapplication.h> #include <kglobal.h> @@ -49,23 +49,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. extern "C" { - KDE_EXPORT KPanelApplet* init(QWidget *parent, const QString& configFile) + KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile) { KGlobal::locale()->insertCatalogue("kmathapplet"); return new MathApplet(configFile, KPanelApplet::Stretch, 0, parent, "kmathapplet"); } } -MathApplet::MathApplet(const QString& configFile, Type type, int actions, - QWidget *parent, const char *name) +MathApplet::MathApplet(const TQString& configFile, Type type, int actions, + TQWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name), m_hasFocus(false) { // setBackgroundMode(X11ParentRelative); setBackgroundOrigin( AncestorOrigin ); // setup label - _label = new QLabel(i18n("Evaluate:"), this); - QFont f(_label->font()); + _label = new TQLabel(i18n("Evaluate:"), this); + TQFont f(_label->font()); f.setPixelSize(12); // _label->setBackgroundMode(X11ParentRelative); _label->setBackgroundOrigin( AncestorOrigin ); @@ -73,19 +73,19 @@ MathApplet::MathApplet(const QString& configFile, Type type, int actions, _label->setFont(f); // setup popup button - _btn = new QPushButton(this); + _btn = new TQPushButton(this); f = _btn->font(); f.setPixelSize(12); _btn->setFont(f); - connect(_btn, SIGNAL(clicked()), SLOT(popup_combo())); + connect(_btn, TQT_SIGNAL(clicked()), TQT_SLOT(popup_combo())); // setup history combo _input = new KHistoryCombo(this); _input->setFocus(); _input->clearEdit(); watchForFocus(_input->lineEdit()); - connect(_input, SIGNAL(activated(const QString&)), - SLOT(evaluate(const QString&))); + connect(_input, TQT_SIGNAL(activated(const TQString&)), + TQT_SLOT(evaluate(const TQString&))); initContextMenu(); useDegrees(); @@ -95,14 +95,14 @@ MathApplet::MathApplet(const QString& configFile, Type type, int actions, // restore history and completion list - QStringList list = c->readListEntry("Completion list"); + TQStringList list = c->readListEntry("Completion list"); _input->completionObject()->setItems(list); list = c->readListEntry("History list"); _input->setHistoryItems(list); int mode = c->readNumEntry( "CompletionMode", KGlobalSettings::completionMode() ); _input->setCompletionMode( (KGlobalSettings::Completion) mode ); - _hbox = new QHBox( 0, 0, WStyle_Customize | WType_Popup ); + _hbox = new TQHBox( 0, 0, WStyle_Customize | WType_Popup ); _hbox->setFixedSize(120, 22); @@ -112,8 +112,8 @@ void MathApplet::initContextMenu() { mContextMenu = new KPopupMenu(this); mContextMenu->setCheckable(true); - mContextMenu->insertItem(i18n("Use &Degrees"), this, SLOT(useDegrees()), 0, 0, 0); - mContextMenu->insertItem(i18n("Use &Radians"), this, SLOT(useRadians()), 0, 1, 1); + mContextMenu->insertItem(i18n("Use &Degrees"), this, TQT_SLOT(useDegrees()), 0, 0, 0); + mContextMenu->insertItem(i18n("Use &Radians"), this, TQT_SLOT(useRadians()), 0, 1, 1); setCustomMenu(mContextMenu); } @@ -124,7 +124,7 @@ MathApplet::~MathApplet() c->setGroup("General"); // save history and completion list - QStringList list = _input->completionObject()->items(); + TQStringList list = _input->completionObject()->items(); c->writeEntry("Completion list", list); list = _input->historyItems(); c->writeEntry("History list", list); @@ -149,12 +149,12 @@ void MathApplet::useRadians() { dummy.setAngleMode(0); } -void MathApplet::resizeEvent(QResizeEvent*) +void MathApplet::resizeEvent(TQResizeEvent*) { if(orientation() == Horizontal) { _btn->hide(); - _input->reparent(this, QPoint(0,0), true); + _input->reparent(this, TQPoint(0,0), true); _label->setGeometry(0,0, width(), _label->height()); if(height() >= _input->sizeHint().height() + _label->height()) @@ -185,7 +185,7 @@ void MathApplet::resizeEvent(QResizeEvent*) { _btn->show(); _btn->setFixedSize(width(), 22); - _input->reparent( _hbox, QPoint(0, 0), false); + _input->reparent( _hbox, TQPoint(0, 0), false); _label->hide(); } setButtonText(); @@ -198,7 +198,7 @@ void MathApplet::positionChange(KPanelApplet::Position) void MathApplet::setButtonText() { - QString t; + TQString t; if (position() == pLeft) { @@ -230,19 +230,19 @@ int MathApplet::heightForWidth(int ) const void MathApplet::popup_combo() { - QPoint p; + TQPoint p; if (position() == pLeft) - p = mapToGlobal(QPoint(-_input->width()-1, 0)); + p = mapToGlobal(TQPoint(-_input->width()-1, 0)); else - p = mapToGlobal(QPoint(width()+1, 0)); + p = mapToGlobal(TQPoint(width()+1, 0)); _hbox->move(p); _hbox->show(); _input->setFocus(); } -void MathApplet::evaluate(const QString& command) +void MathApplet::evaluate(const TQString& command) { - QString exec; + TQString exec; Parser evaluator; @@ -251,7 +251,7 @@ void MathApplet::evaluate(const QString& command) _input->addToHistory(command); - QString cmd = command; + TQString cmd = command; // Nothing interesting. Quit! if ( cmd.isEmpty() ){ @@ -260,7 +260,7 @@ void MathApplet::evaluate(const QString& command) } else { double answer = evaluator.eval(command); if (evaluator.errmsg() == 0) { - QString ansAsString = QString::number(answer); + TQString ansAsString = TQString::number(answer); _input->clearEdit(); _input->setEditText(ansAsString); } else { @@ -273,7 +273,7 @@ void MathApplet::evaluate(const QString& command) _hbox->hide(); } -void MathApplet::mousePressEvent(QMouseEvent *e) +void MathApplet::mousePressEvent(TQMouseEvent *e) { if ( e->button() != RightButton ) { |