diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kalarm/lib/spinbox.cpp | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip |
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4,
however Qt3 builds are OK. Any alterations this commit makes to kdepim
behaviour under Qt3 are unintentional and should be fixed.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kalarm/lib/spinbox.cpp')
-rw-r--r-- | kalarm/lib/spinbox.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/kalarm/lib/spinbox.cpp b/kalarm/lib/spinbox.cpp index 8ae5962a2..19608eabe 100644 --- a/kalarm/lib/spinbox.cpp +++ b/kalarm/lib/spinbox.cpp @@ -24,16 +24,16 @@ #include "spinbox.moc" -SpinBox::SpinBox(TQWidget* parent, const char* name) - : TQSpinBox(0, 99999, 1, parent, name), +SpinBox::SpinBox(TQWidget* tqparent, const char* name) + : TQSpinBox(0, 99999, 1, tqparent, name), mMinValue(TQSpinBox::minValue()), mMaxValue(TQSpinBox::maxValue()) { init(); } -SpinBox::SpinBox(int minValue, int maxValue, int step, TQWidget* parent, const char* name) - : TQSpinBox(minValue, maxValue, step, parent, name), +SpinBox::SpinBox(int minValue, int maxValue, int step, TQWidget* tqparent, const char* name) + : TQSpinBox(minValue, maxValue, step, tqparent, name), mMinValue(minValue), mMaxValue(maxValue) { @@ -212,18 +212,18 @@ bool SpinBox::eventFilter(TQObject* obj, TQEvent* e) // Up and down arrow keys step the value TQKeyEvent* ke = (TQKeyEvent*)e; int key = ke->key(); - if (key == Qt::Key_Up) + if (key == TQt::Key_Up) step = 1; - else if (key == Qt::Key_Down) + else if (key == TQt::Key_Down) step = -1; - shift = ((ke->state() & (Qt::ShiftButton | Qt::AltButton)) == Qt::ShiftButton); + shift = ((ke->state() & (TQt::ShiftButton | TQt::AltButton)) == TQt::ShiftButton); break; } case TQEvent::Wheel: { TQWheelEvent* we = (TQWheelEvent*)e; step = (we->delta() > 0) ? 1 : -1; - shift = ((we->state() & (Qt::ShiftButton | Qt::AltButton)) == Qt::ShiftButton); + shift = ((we->state() & (TQt::ShiftButton | TQt::AltButton)) == TQt::ShiftButton); break; } #if KDE_IS_VERSION(3,1,90) @@ -263,7 +263,7 @@ bool SpinBox::eventFilter(TQObject* obj, TQEvent* e) case TQEvent::MouseButtonDblClick: { TQMouseEvent* me = (TQMouseEvent*)e; - if (me->button() == Qt::LeftButton) + if (me->button() == TQt::LeftButton) { // It's a left button press. Set normal or shift stepping as appropriate. if (mReadOnly) @@ -271,7 +271,7 @@ bool SpinBox::eventFilter(TQObject* obj, TQEvent* e) mCurrentButton = whichButton(me->pos()); if (mCurrentButton == NO_BUTTON) return true; - bool shift = (me->state() & (Qt::ShiftButton | Qt::AltButton)) == Qt::ShiftButton; + bool shift = (me->state() & (TQt::ShiftButton | TQt::AltButton)) == TQt::ShiftButton; if (setShiftStepping(shift, mCurrentButton)) return true; // hide the event from the spin widget return false; // forward event to the destination widget @@ -281,7 +281,7 @@ bool SpinBox::eventFilter(TQObject* obj, TQEvent* e) case TQEvent::MouseButtonRelease: { TQMouseEvent* me = (TQMouseEvent*)e; - if (me->button() == Qt::LeftButton && mShiftMouse) + if (me->button() == TQt::LeftButton && mShiftMouse) { setShiftStepping(false, mCurrentButton); // cancel shift stepping return false; // forward event to the destination widget @@ -291,7 +291,7 @@ bool SpinBox::eventFilter(TQObject* obj, TQEvent* e) case TQEvent::MouseMove: { TQMouseEvent* me = (TQMouseEvent*)e; - if (me->state() & Qt::LeftButton) + if (me->state() & TQt::LeftButton) { // The left button is down. Track which spin button it's in. if (mReadOnly) @@ -302,7 +302,7 @@ bool SpinBox::eventFilter(TQObject* obj, TQEvent* e) // The mouse has moved to a new spin button. // Set normal or shift stepping as appropriate. mCurrentButton = newButton; - bool shift = (me->state() & (Qt::ShiftButton | Qt::AltButton)) == Qt::ShiftButton; + bool shift = (me->state() & (TQt::ShiftButton | TQt::AltButton)) == TQt::ShiftButton; if (setShiftStepping(shift, mCurrentButton)) return true; // hide the event from the spin widget } @@ -313,7 +313,7 @@ bool SpinBox::eventFilter(TQObject* obj, TQEvent* e) case TQEvent::Wheel: { TQWheelEvent* we = (TQWheelEvent*)e; - bool shift = (we->state() & (Qt::ShiftButton | Qt::AltButton)) == Qt::ShiftButton; + bool shift = (we->state() & (TQt::ShiftButton | TQt::AltButton)) == TQt::ShiftButton; if (setShiftStepping(shift, (we->delta() > 0 ? UP : DOWN))) return true; // hide the event from the spin widget return false; // forward event to the destination widget @@ -325,14 +325,14 @@ bool SpinBox::eventFilter(TQObject* obj, TQEvent* e) TQKeyEvent* ke = (TQKeyEvent*)e; int key = ke->key(); int state = ke->state(); - if ((state & Qt::LeftButton) - && (key == Qt::Key_Shift || key == Qt::Key_Alt)) + if ((state & TQt::LeftButton) + && (key == TQt::Key_Shift || key == TQt::Key_Alt)) { // The left mouse button is down, and the Shift or Alt key has changed if (mReadOnly) return true; // discard the event - state ^= (key == Qt::Key_Shift) ? Qt::ShiftButton : Qt::AltButton; // new state - bool shift = (state & (Qt::ShiftButton | Qt::AltButton)) == Qt::ShiftButton; + state ^= (key == TQt::Key_Shift) ? TQt::ShiftButton : TQt::AltButton; // new state + bool shift = (state & (TQt::ShiftButton | TQt::AltButton)) == TQt::ShiftButton; if ((!shift && mShiftMouse) || (shift && !mShiftMouse)) { // The effective shift state has changed. |