diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kalarm/lib | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kalarm/lib')
41 files changed, 761 insertions, 761 deletions
diff --git a/kalarm/lib/buttongroup.cpp b/kalarm/lib/buttongroup.cpp index b448df48a..018640123 100644 --- a/kalarm/lib/buttongroup.cpp +++ b/kalarm/lib/buttongroup.cpp @@ -1,5 +1,5 @@ /* - * buttongroup.cpp - QButtonGroup with an extra signal and KDE 2 compatibility + * buttongroup.cpp - TQButtonGroup with an extra signal and KDE 2 compatibility * Program: kalarm * Copyright (c) 2002, 2004 by David Jarvie <software@astrojar.org.uk> * @@ -19,45 +19,45 @@ */ #include "kalarm.h" -#include <qlayout.h> -#include <qbutton.h> +#include <tqlayout.h> +#include <tqbutton.h> #include <kdialog.h> #include "buttongroup.moc" -ButtonGroup::ButtonGroup(QWidget* parent, const char* name) - : QButtonGroup(parent, name) +ButtonGroup::ButtonGroup(TQWidget* parent, const char* name) + : TQButtonGroup(parent, name) { - connect(this, SIGNAL(clicked(int)), SIGNAL(buttonSet(int))); + connect(this, TQT_SIGNAL(clicked(int)), TQT_SIGNAL(buttonSet(int))); } -ButtonGroup::ButtonGroup(const QString& title, QWidget* parent, const char* name) - : QButtonGroup(title, parent, name) +ButtonGroup::ButtonGroup(const TQString& title, TQWidget* parent, const char* name) + : TQButtonGroup(title, parent, name) { - connect(this, SIGNAL(clicked(int)), SIGNAL(buttonSet(int))); + connect(this, TQT_SIGNAL(clicked(int)), TQT_SIGNAL(buttonSet(int))); } -ButtonGroup::ButtonGroup(int strips, Qt::Orientation orient, QWidget* parent, const char* name) - : QButtonGroup(strips, orient, parent, name) +ButtonGroup::ButtonGroup(int strips, Qt::Orientation orient, TQWidget* parent, const char* name) + : TQButtonGroup(strips, orient, parent, name) { - connect(this, SIGNAL(clicked(int)), SIGNAL(buttonSet(int))); + connect(this, TQT_SIGNAL(clicked(int)), TQT_SIGNAL(buttonSet(int))); } -ButtonGroup::ButtonGroup(int strips, Qt::Orientation orient, const QString& title, QWidget* parent, const char* name) - : QButtonGroup(strips, orient, title, parent, name) +ButtonGroup::ButtonGroup(int strips, Qt::Orientation orient, const TQString& title, TQWidget* parent, const char* name) + : TQButtonGroup(strips, orient, title, parent, name) { - connect(this, SIGNAL(clicked(int)), SIGNAL(buttonSet(int))); + connect(this, TQT_SIGNAL(clicked(int)), TQT_SIGNAL(buttonSet(int))); } /****************************************************************************** * Inserts a button in the group. * This should really be a virtual method... */ -int ButtonGroup::insert(QButton* button, int id) +int ButtonGroup::insert(TQButton* button, int id) { - id = QButtonGroup::insert(button, id); - connect(button, SIGNAL(toggled(bool)), SLOT(slotButtonToggled(bool))); + id = TQButtonGroup::insert(button, id); + connect(button, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotButtonToggled(bool))); return id; } diff --git a/kalarm/lib/buttongroup.h b/kalarm/lib/buttongroup.h index 1d647b420..8fbadae77 100644 --- a/kalarm/lib/buttongroup.h +++ b/kalarm/lib/buttongroup.h @@ -1,5 +1,5 @@ /* - * buttongroup.h - QButtonGroup with an extra signal and Qt 2 compatibility + * buttongroup.h - TQButtonGroup with an extra signal and Qt 2 compatibility * Program: kalarm * Copyright © 2002,2004,2006 by David Jarvie <software@astrojar.org.uk> * @@ -20,17 +20,17 @@ #ifndef BUTTONGROUP_H #define BUTTONGROUP_H -#include <qbuttongroup.h> +#include <tqbuttongroup.h> /** - * @short A QButtonGroup with signal on new selection, plus Qt 2 compatibility. + * @short A TQButtonGroup with signal on new selection, plus Qt 2 compatibility. * - * The ButtonGroup class provides an enhanced version of the QButtonGroup class. + * The ButtonGroup class provides an enhanced version of the TQButtonGroup class. * * It emits an additional signal, buttonSet(int), whenever any of its buttons * changes state, for whatever reason, including programmatic control. (The - * QButtonGroup class only emits signals when buttons are clicked on by the user.) + * TQButtonGroup class only emits signals when buttons are clicked on by the user.) * The class also provides Qt 2 compatibility. * * @author David Jarvie <software@astrojar.org.uk> @@ -43,20 +43,20 @@ class ButtonGroup : public QButtonGroup * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit ButtonGroup(QWidget* parent, const char* name = 0); + explicit ButtonGroup(TQWidget* parent, const char* name = 0); /** Constructor. * @param title The title displayed for this button group. * @param parent The parent object of this widget. * @param name The name of this widget. */ - ButtonGroup(const QString& title, QWidget* parent, const char* name = 0); + ButtonGroup(const TQString& title, TQWidget* parent, const char* name = 0); /** Constructor. * @param strips The number of rows or columns of buttons. * @param orient The orientation (Qt::Horizontal or Qt::Vertical) of the button group. * @param parent The parent object of this widget. * @param name The name of this widget. */ - ButtonGroup(int strips, Qt::Orientation orient, QWidget* parent, const char* name = 0); + ButtonGroup(int strips, Qt::Orientation orient, TQWidget* parent, const char* name = 0); /** Constructor. * @param strips The number of rows or columns of buttons. * @param orient The orientation (Qt::Horizontal or Qt::Vertical) of the button group. @@ -64,19 +64,19 @@ class ButtonGroup : public QButtonGroup * @param parent The parent object of this widget. * @param name The name of this widget. */ - ButtonGroup(int strips, Qt::Orientation orient, const QString& title, QWidget* parent, const char* name = 0); + ButtonGroup(int strips, Qt::Orientation orient, const TQString& title, TQWidget* parent, const char* name = 0); /** Inserts a button in the group. - * This overrides the insert() method of QButtonGroup, which should really be a virtual method... + * This overrides the insert() method of TQButtonGroup, which should really be a virtual method... * @param button The button to insert. * @param id The identifier for the button. * @return The identifier of the inserted button. */ - int insert(QButton* button, int id = -1); + int insert(TQButton* button, int id = -1); /** Sets the button with the specified identifier to be on. If this is an exclusive group, * all other buttons in the group will be set off. The buttonSet() signal is emitted. * @param id The identifier of the button to set on. */ - virtual void setButton(int id) { QButtonGroup::setButton(id); emit buttonSet(id); } + virtual void setButton(int id) { TQButtonGroup::setButton(id); emit buttonSet(id); } private slots: void slotButtonToggled(bool); signals: diff --git a/kalarm/lib/checkbox.cpp b/kalarm/lib/checkbox.cpp index c600a4950..dde0d10ff 100644 --- a/kalarm/lib/checkbox.cpp +++ b/kalarm/lib/checkbox.cpp @@ -21,15 +21,15 @@ #include "checkbox.moc" -CheckBox::CheckBox(QWidget* parent, const char* name) - : QCheckBox(parent, name), +CheckBox::CheckBox(TQWidget* parent, const char* name) + : TQCheckBox(parent, name), mFocusPolicy(focusPolicy()), mFocusWidget(0), mReadOnly(false) { } -CheckBox::CheckBox(const QString& text, QWidget* parent, const char* name) - : QCheckBox(text, parent, name), +CheckBox::CheckBox(const TQString& text, TQWidget* parent, const char* name) + : TQCheckBox(text, parent, name), mFocusPolicy(focusPolicy()), mFocusWidget(0), mReadOnly(false) @@ -44,7 +44,7 @@ void CheckBox::setReadOnly(bool ro) if ((int)ro != (int)mReadOnly) { mReadOnly = ro; - setFocusPolicy(ro ? QWidget::NoFocus : mFocusPolicy); + setFocusPolicy(ro ? TQWidget::NoFocus : mFocusPolicy); if (ro) clearFocus(); } @@ -53,14 +53,14 @@ void CheckBox::setReadOnly(bool ro) /****************************************************************************** * Specify a widget to receive focus when the checkbox is clicked on. */ -void CheckBox::setFocusWidget(QWidget* w, bool enable) +void CheckBox::setFocusWidget(TQWidget* w, bool enable) { mFocusWidget = w; mFocusWidgetEnable = enable; if (w) - connect(this, SIGNAL(clicked()), SLOT(slotClicked())); + connect(this, TQT_SIGNAL(clicked()), TQT_SLOT(slotClicked())); else - disconnect(this, SIGNAL(clicked()), this, SLOT(slotClicked())); + disconnect(this, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClicked())); } /****************************************************************************** @@ -81,7 +81,7 @@ void CheckBox::slotClicked() * Event handlers to intercept events if in read-only mode. * Any events which could change the checkbox state are discarded. */ -void CheckBox::mousePressEvent(QMouseEvent* e) +void CheckBox::mousePressEvent(TQMouseEvent* e) { if (mReadOnly) { @@ -89,10 +89,10 @@ void CheckBox::mousePressEvent(QMouseEvent* e) if (e->button() == Qt::LeftButton) return; } - QCheckBox::mousePressEvent(e); + TQCheckBox::mousePressEvent(e); } -void CheckBox::mouseReleaseEvent(QMouseEvent* e) +void CheckBox::mouseReleaseEvent(TQMouseEvent* e) { if (mReadOnly) { @@ -100,16 +100,16 @@ void CheckBox::mouseReleaseEvent(QMouseEvent* e) if (e->button() == Qt::LeftButton) return; } - QCheckBox::mouseReleaseEvent(e); + TQCheckBox::mouseReleaseEvent(e); } -void CheckBox::mouseMoveEvent(QMouseEvent* e) +void CheckBox::mouseMoveEvent(TQMouseEvent* e) { if (!mReadOnly) - QCheckBox::mouseMoveEvent(e); + TQCheckBox::mouseMoveEvent(e); } -void CheckBox::keyPressEvent(QKeyEvent* e) +void CheckBox::keyPressEvent(TQKeyEvent* e) { if (mReadOnly) switch (e->key()) @@ -123,11 +123,11 @@ void CheckBox::keyPressEvent(QKeyEvent* e) default: return; } - QCheckBox::keyPressEvent(e); + TQCheckBox::keyPressEvent(e); } -void CheckBox::keyReleaseEvent(QKeyEvent* e) +void CheckBox::keyReleaseEvent(TQKeyEvent* e) { if (!mReadOnly) - QCheckBox::keyReleaseEvent(e); + TQCheckBox::keyReleaseEvent(e); } diff --git a/kalarm/lib/checkbox.h b/kalarm/lib/checkbox.h index 72ad4aee3..fc7f82cbd 100644 --- a/kalarm/lib/checkbox.h +++ b/kalarm/lib/checkbox.h @@ -21,13 +21,13 @@ #ifndef CHECKBOX_H #define CHECKBOX_H -#include <qcheckbox.h> +#include <tqcheckbox.h> /** - * @short A QCheckBox with focus widget and read-only options. + * @short A TQCheckBox with focus widget and read-only options. * - * The CheckBox class is a QCheckBox with the ability to transfer focus to another + * The CheckBox class is a TQCheckBox with the ability to transfer focus to another * widget when checked, and with a read-only option. * * Another widget may be specified as the focus widget for the check box. Whenever @@ -47,13 +47,13 @@ class CheckBox : public QCheckBox * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit CheckBox(QWidget* parent, const char* name = 0); + explicit CheckBox(TQWidget* parent, const char* name = 0); /** Constructor. * @param text Text to display. * @param parent The parent object of this widget. * @param name The name of this widget. */ - CheckBox(const QString& text, QWidget* parent, const char* name = 0); + CheckBox(const TQString& text, TQWidget* parent, const char* name = 0); /** Returns true if the widget is read only. */ bool isReadOnly() const { return mReadOnly; } /** Sets whether the check box is read-only for the user. If read-only, @@ -62,25 +62,25 @@ class CheckBox : public QCheckBox */ virtual void setReadOnly(bool readOnly); /** Returns the widget which receives focus when the user selects the check box by clicking on it. */ - QWidget* focusWidget() const { return mFocusWidget; } + TQWidget* focusWidget() const { return mFocusWidget; } /** Specifies a widget to receive focus when the user selects the check box by clicking on it. * @param widget Widget to receive focus. * @param enable If true, @p widget will be enabled before receiving focus. If * false, the enabled state of @p widget will be left unchanged when * the check box is clicked. */ - void setFocusWidget(QWidget* widget, bool enable = true); + void setFocusWidget(TQWidget* widget, bool enable = true); protected: - virtual void mousePressEvent(QMouseEvent*); - virtual void mouseReleaseEvent(QMouseEvent*); - virtual void mouseMoveEvent(QMouseEvent*); - virtual void keyPressEvent(QKeyEvent*); - virtual void keyReleaseEvent(QKeyEvent*); + virtual void mousePressEvent(TQMouseEvent*); + virtual void mouseReleaseEvent(TQMouseEvent*); + virtual void mouseMoveEvent(TQMouseEvent*); + virtual void keyPressEvent(TQKeyEvent*); + virtual void keyReleaseEvent(TQKeyEvent*); protected slots: void slotClicked(); private: - QWidget::FocusPolicy mFocusPolicy; // default focus policy for the QCheckBox - QWidget* mFocusWidget; // widget to receive focus when button is clicked on + TQWidget::FocusPolicy mFocusPolicy; // default focus policy for the QCheckBox + TQWidget* mFocusWidget; // widget to receive focus when button is clicked on bool mFocusWidgetEnable; // enable focus widget before setting focus bool mReadOnly; // value cannot be changed }; diff --git a/kalarm/lib/colourcombo.cpp b/kalarm/lib/colourcombo.cpp index d5fa052ac..9cf09ce13 100644 --- a/kalarm/lib/colourcombo.cpp +++ b/kalarm/lib/colourcombo.cpp @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qpainter.h> +#include <tqpainter.h> #include <klocale.h> #include <kcolordialog.h> @@ -30,8 +30,8 @@ #include "colourcombo.moc" -ColourCombo::ColourCombo(QWidget* parent, const char* name, const QColor& defaultColour) - : QComboBox(parent, name), +ColourCombo::ColourCombo(TQWidget* parent, const char* name, const TQColor& defaultColour) + : TQComboBox(parent, name), mColourList(Preferences::messageColours()), mSelectedColour(defaultColour), mCustomColour(255, 255, 255), @@ -39,12 +39,12 @@ ColourCombo::ColourCombo(QWidget* parent, const char* name, const QColor& defaul mDisabled(false) { addColours(); - connect(this, SIGNAL(activated(int)), SLOT(slotActivated(int))); - connect(this, SIGNAL(highlighted(int)), SLOT(slotHighlighted(int))); - Preferences::connect(SIGNAL(preferencesChanged()), this, SLOT(slotPreferencesChanged())); + connect(this, TQT_SIGNAL(activated(int)), TQT_SLOT(slotActivated(int))); + connect(this, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotHighlighted(int))); + Preferences::connect(TQT_SIGNAL(preferencesChanged()), this, TQT_SLOT(slotPreferencesChanged())); } -void ColourCombo::setColour(const QColor& colour) +void ColourCombo::setColour(const TQColor& colour) { mSelectedColour = colour; addColours(); @@ -94,14 +94,14 @@ void ColourCombo::setEnabled(bool enable) if (end > 1) { // Add a dialog background colour item - QPixmap pm = *pixmap(1); + TQPixmap pm = *pixmap(1); pm.fill(paletteBackgroundColor()); insertItem(pm); setCurrentItem(end); } mDisabled = true; } - QComboBox::setEnabled(enable); + TQComboBox::setEnabled(enable); } void ColourCombo::slotActivated(int index) @@ -110,9 +110,9 @@ void ColourCombo::slotActivated(int index) mSelectedColour = mColourList[index - 1]; else { - if (KColorDialog::getColor(mCustomColour, this) == QDialog::Accepted) + if (KColorDialog::getColor(mCustomColour, this) == TQDialog::Accepted) { - QRect rect; + TQRect rect; drawCustomItem(rect, false); } mSelectedColour = mCustomColour; @@ -144,16 +144,16 @@ void ColourCombo::addColours() break; } - QRect rect; + TQRect rect; drawCustomItem(rect, true); - QPainter painter; - QPixmap pixmap(rect.width(), rect.height()); + TQPainter painter; + TQPixmap pixmap(rect.width(), rect.height()); int i = 1; for (ColourList::const_iterator it = mColourList.begin(); it != mColourList.end(); ++i, ++it) { painter.begin(&pixmap); - QBrush brush(*it); + TQBrush brush(*it); painter.fillRect(rect, brush); painter.end(); @@ -165,21 +165,21 @@ void ColourCombo::addColours() } } -void ColourCombo::drawCustomItem(QRect& rect, bool insert) +void ColourCombo::drawCustomItem(TQRect& rect, bool insert) { - QPen pen; + TQPen pen; if (qGray(mCustomColour.rgb()) < 128) pen.setColor(Qt::white); else pen.setColor(Qt::black); - QPainter painter; - QFontMetrics fm = QFontMetrics(painter.font()); + TQPainter painter; + TQFontMetrics fm = TQFontMetrics(painter.font()); rect.setRect(0, 0, width(), fm.height() + 4); - QPixmap pixmap(rect.width(), rect.height()); + TQPixmap pixmap(rect.width(), rect.height()); painter.begin(&pixmap); - QBrush brush(mCustomColour); + TQBrush brush(mCustomColour); painter.fillRect(rect, brush); painter.setPen(pen); painter.drawText(2, fm.ascent() + 2, i18n("Custom...")); @@ -197,13 +197,13 @@ void ColourCombo::setReadOnly(bool ro) mReadOnly = ro; } -void ColourCombo::resizeEvent(QResizeEvent* re) +void ColourCombo::resizeEvent(TQResizeEvent* re) { - QComboBox::resizeEvent(re); + TQComboBox::resizeEvent(re); addColours(); } -void ColourCombo::mousePressEvent(QMouseEvent* e) +void ColourCombo::mousePressEvent(TQMouseEvent* e) { if (mReadOnly) { @@ -211,29 +211,29 @@ void ColourCombo::mousePressEvent(QMouseEvent* e) if (e->button() == Qt::LeftButton) return; } - QComboBox::mousePressEvent(e); + TQComboBox::mousePressEvent(e); } -void ColourCombo::mouseReleaseEvent(QMouseEvent* e) +void ColourCombo::mouseReleaseEvent(TQMouseEvent* e) { if (!mReadOnly) - QComboBox::mouseReleaseEvent(e); + TQComboBox::mouseReleaseEvent(e); } -void ColourCombo::mouseMoveEvent(QMouseEvent* e) +void ColourCombo::mouseMoveEvent(TQMouseEvent* e) { if (!mReadOnly) - QComboBox::mouseMoveEvent(e); + TQComboBox::mouseMoveEvent(e); } -void ColourCombo::keyPressEvent(QKeyEvent* e) +void ColourCombo::keyPressEvent(TQKeyEvent* e) { if (!mReadOnly || e->key() == Qt::Key_Escape) - QComboBox::keyPressEvent(e); + TQComboBox::keyPressEvent(e); } -void ColourCombo::keyReleaseEvent(QKeyEvent* e) +void ColourCombo::keyReleaseEvent(TQKeyEvent* e) { if (!mReadOnly) - QComboBox::keyReleaseEvent(e); + TQComboBox::keyReleaseEvent(e); } diff --git a/kalarm/lib/colourcombo.h b/kalarm/lib/colourcombo.h index f3e4ebca6..b05f78823 100644 --- a/kalarm/lib/colourcombo.h +++ b/kalarm/lib/colourcombo.h @@ -21,7 +21,7 @@ #ifndef COLOURCOMBO_H #define COLOURCOMBO_H -#include <qcombobox.h> +#include <tqcombobox.h> #include "colourlist.h" @@ -43,22 +43,22 @@ class ColourCombo : public QComboBox { Q_OBJECT - Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(TQColor color READ color WRITE setColor) public: /** Constructor. * @param parent The parent object of this widget. * @param name The name of this widget. * @param defaultColour The colour which is selected by default. */ - explicit ColourCombo(QWidget* parent = 0, const char* name = 0, const QColor& defaultColour = 0xFFFFFF); + explicit ColourCombo(TQWidget* parent = 0, const char* name = 0, const TQColor& defaultColour = 0xFFFFFF); /** Returns the selected colour. */ - QColor color() const { return mSelectedColour; } + TQColor color() const { return mSelectedColour; } /** Returns the selected colour. */ - QColor colour() const { return mSelectedColour; } + TQColor colour() const { return mSelectedColour; } /** Sets the selected colour to @p c. */ - void setColor(const QColor& c) { setColour(c); } + void setColor(const TQColor& c) { setColour(c); } /** Sets the selected colour to @p c. */ - void setColour(const QColor& c); + void setColour(const TQColor& c); /** Initialises the list of colours to @p list. */ void setColours(const ColourList& list); /** Returns true if the first entry in the list, i.e. the custom colour, is selected. */ @@ -71,30 +71,30 @@ class ColourCombo : public QComboBox virtual void setReadOnly(bool readOnly); signals: /** Signal emitted when a new colour has been selected. */ - void activated(const QColor&); // a new colour box has been selected + void activated(const TQColor&); // a new colour box has been selected /** Signal emitted when a new colour has been highlighted. */ - void highlighted(const QColor&); // a new item has been highlighted + void highlighted(const TQColor&); // a new item has been highlighted public slots: /** Enables or disables the widget. */ virtual void setEnabled(bool enabled); protected: - virtual void resizeEvent(QResizeEvent*); - virtual void mousePressEvent(QMouseEvent*); - virtual void mouseReleaseEvent(QMouseEvent*); - virtual void mouseMoveEvent(QMouseEvent*); - virtual void keyPressEvent(QKeyEvent*); - virtual void keyReleaseEvent(QKeyEvent*); + virtual void resizeEvent(TQResizeEvent*); + virtual void mousePressEvent(TQMouseEvent*); + virtual void mouseReleaseEvent(TQMouseEvent*); + virtual void mouseMoveEvent(TQMouseEvent*); + virtual void keyPressEvent(TQKeyEvent*); + virtual void keyReleaseEvent(TQKeyEvent*); private slots: void slotActivated(int index); void slotHighlighted(int index); void slotPreferencesChanged(); private: void addColours(); - void drawCustomItem(QRect&, bool insert); + void drawCustomItem(TQRect&, bool insert); ColourList mColourList; // the sorted colours to display - QColor mSelectedColour; // currently selected colour - QColor mCustomColour; // current colour of the Custom item + TQColor mSelectedColour; // currently selected colour + TQColor mCustomColour; // current colour of the Custom item bool mReadOnly; // value cannot be changed bool mDisabled; }; diff --git a/kalarm/lib/colourlist.cpp b/kalarm/lib/colourlist.cpp index e02a64466..93886b5fa 100644 --- a/kalarm/lib/colourlist.cpp +++ b/kalarm/lib/colourlist.cpp @@ -21,16 +21,16 @@ #include "colourlist.h" -ColourList::ColourList(const QColor* colours) +ColourList::ColourList(const TQColor* colours) { while (colours->isValid()) mList.append((*colours++).rgb()); } -void ColourList::insert(const QColor& colour) +void ColourList::insert(const TQColor& colour) { QRgb rgb = colour.rgb(); - for (QValueListIterator<QRgb> it = mList.begin(); it != mList.end(); ++it) + for (TQValueListIterator<QRgb> it = mList.begin(); it != mList.end(); ++it) { if (rgb <= *it) { diff --git a/kalarm/lib/colourlist.h b/kalarm/lib/colourlist.h index ef641c04a..a20a44d6a 100644 --- a/kalarm/lib/colourlist.h +++ b/kalarm/lib/colourlist.h @@ -21,9 +21,9 @@ #ifndef COLOURLIST_H #define COLOURLIST_H -#include <qtl.h> -#include <qcolor.h> -#include <qvaluelist.h> +#include <tqtl.h> +#include <tqcolor.h> +#include <tqvaluelist.h> /** @@ -31,8 +31,8 @@ * * The ColourList class holds a list of colours, sorted in RGB value order. * - * It provides a sorted QValueList of colours in RGB value order, with iterators - * and other access methods which return either QRgb or QColor objects. + * It provides a sorted TQValueList of colours in RGB value order, with iterators + * and other access methods which return either QRgb or TQColor objects. * * @author David Jarvie <software@astrojar.org.uk> */ @@ -40,30 +40,30 @@ class ColourList { public: typedef size_t size_type; - typedef QValueListConstIterator<QRgb> const_iterator; + typedef TQValueListConstIterator<QRgb> const_iterator; /** Constructs an empty list. */ ColourList() { } /** Copy constructor. */ ColourList(const ColourList& l) : mList(l.mList) { } /** Constructs a list whose values are preset to the colours in @p list. */ - ColourList(const QValueList<QRgb>& list) : mList(list) { qHeapSort(mList); } + ColourList(const TQValueList<QRgb>& list) : mList(list) { qHeapSort(mList); } /** Constructs a list whose values are preset to the colours in the @p list. * Terminate @p list by an invalid colour. */ - ColourList(const QColor* list); + ColourList(const TQColor* list); /** Assignment operator. */ ColourList& operator=(const ColourList& l) { mList = l.mList; return *this; } /** Sets the list to comprise the colours in @p list. */ - ColourList& operator=(const QValueList<QRgb>& list) { mList = list; qHeapSort(mList); return *this; } + ColourList& operator=(const TQValueList<QRgb>& list) { mList = list; qHeapSort(mList); return *this; } /** Removes all values from the list. */ void clear() { mList.clear(); } /** Adds the specified colour @p c to the list. */ - void insert(const QColor& c); + void insert(const TQColor& c); /** Removes the colour @p c from the list. */ - void remove(const QColor& c) { mList.remove(c.rgb()); } + void remove(const TQColor& c) { mList.remove(c.rgb()); } /** Adds the specified colour @p c to the list. */ - ColourList& operator+=(const QColor& c) { insert(c); return *this; } + ColourList& operator+=(const TQColor& c) { insert(c); return *this; } /** Adds the colours in @p list to this list. */ ColourList& operator+=(const ColourList& list) { mList += list.mList; qHeapSort(mList); return *this; } /** Returns true if the colours in the two lists are the same. */ @@ -83,28 +83,28 @@ class ColourList /** Returns an iterator pointing to the colour at position @p i in the list. */ const_iterator at(size_type i) const { return mList.at(i); } /** Returns true if the list contains the colour @p c. */ - size_type contains(const QColor& c) const { return mList.contains(c.rgb()); } + size_type contains(const TQColor& c) const { return mList.contains(c.rgb()); } /** Returns an iterator pointing to the first occurrence of colour @p c in the list. * Returns end() if colour @p c is not in the list. */ - const_iterator find(const QColor& c) const { return mList.find(c.rgb()); } + const_iterator find(const TQColor& c) const { return mList.find(c.rgb()); } /** Returns an iterator pointing to the first occurrence of colour @p c in the list, starting. * from position @p it. Returns end() if colour @p c is not in the list. */ - const_iterator find(const_iterator it, const QColor& c) const { return mList.find(it, c.rgb()); } + const_iterator find(const_iterator it, const TQColor& c) const { return mList.find(it, c.rgb()); } /** Returns the index to the first occurrence of colour @p c in the list. * Returns -1 if colour @p c is not in the list. */ - int findIndex(const QColor& c) const { return mList.findIndex(c.rgb()); } + int findIndex(const TQColor& c) const { return mList.findIndex(c.rgb()); } /** Returns the first colour in the list. If the list is empty, the result is undefined. */ - QColor first() const { return QColor(mList.first()); } + TQColor first() const { return TQColor(mList.first()); } /** Returns the last colour in the list. If the list is empty, the result is undefined. */ - QColor last() const { return QColor(mList.last()); } + TQColor last() const { return TQColor(mList.last()); } /** Returns the colour at position @p i in the list. If the item does not exist, the result is undefined. */ - QColor operator[](size_type i) const { return QColor(mList[i]); } + TQColor operator[](size_type i) const { return TQColor(mList[i]); } private: void sort(); - QValueList<QRgb> mList; + TQValueList<QRgb> mList; }; #endif // COLOURLIST_H diff --git a/kalarm/lib/combobox.cpp b/kalarm/lib/combobox.cpp index 7e0bea4bd..bb232ffe5 100644 --- a/kalarm/lib/combobox.cpp +++ b/kalarm/lib/combobox.cpp @@ -18,17 +18,17 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qlineedit.h> +#include <tqlineedit.h> #include "combobox.moc" -ComboBox::ComboBox(QWidget* parent, const char* name) - : QComboBox(parent, name), +ComboBox::ComboBox(TQWidget* parent, const char* name) + : TQComboBox(parent, name), mReadOnly(false) { } -ComboBox::ComboBox(bool rw, QWidget* parent, const char* name) - : QComboBox(rw, parent, name), +ComboBox::ComboBox(bool rw, TQWidget* parent, const char* name) + : TQComboBox(rw, parent, name), mReadOnly(false) { } @@ -42,7 +42,7 @@ void ComboBox::setReadOnly(bool ro) } } -void ComboBox::mousePressEvent(QMouseEvent* e) +void ComboBox::mousePressEvent(TQMouseEvent* e) { if (mReadOnly) { @@ -50,29 +50,29 @@ void ComboBox::mousePressEvent(QMouseEvent* e) if (e->button() == Qt::LeftButton) return; } - QComboBox::mousePressEvent(e); + TQComboBox::mousePressEvent(e); } -void ComboBox::mouseReleaseEvent(QMouseEvent* e) +void ComboBox::mouseReleaseEvent(TQMouseEvent* e) { if (!mReadOnly) - QComboBox::mouseReleaseEvent(e); + TQComboBox::mouseReleaseEvent(e); } -void ComboBox::mouseMoveEvent(QMouseEvent* e) +void ComboBox::mouseMoveEvent(TQMouseEvent* e) { if (!mReadOnly) - QComboBox::mouseMoveEvent(e); + TQComboBox::mouseMoveEvent(e); } -void ComboBox::keyPressEvent(QKeyEvent* e) +void ComboBox::keyPressEvent(TQKeyEvent* e) { if (!mReadOnly || e->key() == Qt::Key_Escape) - QComboBox::keyPressEvent(e); + TQComboBox::keyPressEvent(e); } -void ComboBox::keyReleaseEvent(QKeyEvent* e) +void ComboBox::keyReleaseEvent(TQKeyEvent* e) { if (!mReadOnly) - QComboBox::keyReleaseEvent(e); + TQComboBox::keyReleaseEvent(e); } diff --git a/kalarm/lib/combobox.h b/kalarm/lib/combobox.h index d33ac147e..3f33a63db 100644 --- a/kalarm/lib/combobox.h +++ b/kalarm/lib/combobox.h @@ -21,13 +21,13 @@ #ifndef COMBOBOX_H #define COMBOBOX_H -#include <qcombobox.h> +#include <tqcombobox.h> /** - * @short A QComboBox with read-only option. + * @short A TQComboBox with read-only option. * - * The ComboBox class is a QComboBox with a read-only option. + * The ComboBox class is a TQComboBox with a read-only option. * * The widget may be set as read-only. This has the same effect as disabling it, except * that its appearance is unchanged. @@ -42,13 +42,13 @@ class ComboBox : public QComboBox * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit ComboBox(QWidget* parent = 0, const char* name = 0); + explicit ComboBox(TQWidget* parent = 0, const char* name = 0); /** Constructor. * @param rw True for a read-write combo box, false for a read-only combo box. * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit ComboBox(bool rw, QWidget* parent = 0, const char* name = 0); + explicit ComboBox(bool rw, TQWidget* parent = 0, const char* name = 0); /** Returns true if the widget is read only. */ bool isReadOnly() const { return mReadOnly; } /** Sets whether the combo box is read-only for the user. If read-only, @@ -57,11 +57,11 @@ class ComboBox : public QComboBox */ virtual void setReadOnly(bool readOnly); protected: - virtual void mousePressEvent(QMouseEvent*); - virtual void mouseReleaseEvent(QMouseEvent*); - virtual void mouseMoveEvent(QMouseEvent*); - virtual void keyPressEvent(QKeyEvent*); - virtual void keyReleaseEvent(QKeyEvent*); + virtual void mousePressEvent(TQMouseEvent*); + virtual void mouseReleaseEvent(TQMouseEvent*); + virtual void mouseMoveEvent(TQMouseEvent*); + virtual void keyPressEvent(TQKeyEvent*); + virtual void keyReleaseEvent(TQKeyEvent*); private: bool mReadOnly; // value cannot be changed }; diff --git a/kalarm/lib/dateedit.cpp b/kalarm/lib/dateedit.cpp index 71553d704..2fef25de5 100644 --- a/kalarm/lib/dateedit.cpp +++ b/kalarm/lib/dateedit.cpp @@ -25,13 +25,13 @@ #include "dateedit.moc" -DateEdit::DateEdit(QWidget* parent, const char* name) +DateEdit::DateEdit(TQWidget* parent, const char* name) : KDateEdit(parent, name) { - connect(this, SIGNAL(dateEntered(const QDate&)), SLOT(newDateEntered(const QDate&))); + connect(this, TQT_SIGNAL(dateEntered(const TQDate&)), TQT_SLOT(newDateEntered(const TQDate&))); } -void DateEdit::setMinDate(const QDate& d, const QString& errorDate) +void DateEdit::setMinDate(const TQDate& d, const TQString& errorDate) { mMinDate = d; if (mMinDate.isValid() && date().isValid() && date() < mMinDate) @@ -39,7 +39,7 @@ void DateEdit::setMinDate(const QDate& d, const QString& errorDate) mMinDateErrString = errorDate; } -void DateEdit::setMaxDate(const QDate& d, const QString& errorDate) +void DateEdit::setMaxDate(const TQDate& d, const TQString& errorDate) { mMaxDate = d; if (mMaxDate.isValid() && date().isValid() && date() > mMaxDate) @@ -49,11 +49,11 @@ void DateEdit::setMaxDate(const QDate& d, const QString& errorDate) void DateEdit::setInvalid() { - setDate(QDate()); + setDate(TQDate()); } // Check a new date against any minimum or maximum date. -void DateEdit::newDateEntered(const QDate& newDate) +void DateEdit::newDateEntered(const TQDate& newDate) { if (newDate.isValid()) { @@ -72,12 +72,12 @@ void DateEdit::newDateEntered(const QDate& newDate) } } -void DateEdit::pastLimitMessage(const QDate& limit, const QString& error, const QString& defaultError) +void DateEdit::pastLimitMessage(const TQDate& limit, const TQString& error, const TQString& defaultError) { - QString errString = error; + TQString errString = error; if (errString.isNull()) { - if (limit == QDate::currentDate()) + if (limit == TQDate::currentDate()) errString = i18n("today"); else errString = KGlobal::locale()->formatDate(limit, true); @@ -86,7 +86,7 @@ void DateEdit::pastLimitMessage(const QDate& limit, const QString& error, const KMessageBox::sorry(this, errString); } -void DateEdit::mousePressEvent(QMouseEvent *e) +void DateEdit::mousePressEvent(TQMouseEvent *e) { if (isReadOnly()) { @@ -97,25 +97,25 @@ void DateEdit::mousePressEvent(QMouseEvent *e) KDateEdit::mousePressEvent(e); } -void DateEdit::mouseReleaseEvent(QMouseEvent* e) +void DateEdit::mouseReleaseEvent(TQMouseEvent* e) { if (!isReadOnly()) KDateEdit::mouseReleaseEvent(e); } -void DateEdit::mouseMoveEvent(QMouseEvent* e) +void DateEdit::mouseMoveEvent(TQMouseEvent* e) { if (!isReadOnly()) KDateEdit::mouseMoveEvent(e); } -void DateEdit::keyPressEvent(QKeyEvent* e) +void DateEdit::keyPressEvent(TQKeyEvent* e) { if (!isReadOnly()) KDateEdit::keyPressEvent(e); } -void DateEdit::keyReleaseEvent(QKeyEvent* e) +void DateEdit::keyReleaseEvent(TQKeyEvent* e) { if (!isReadOnly()) KDateEdit::keyReleaseEvent(e); diff --git a/kalarm/lib/dateedit.h b/kalarm/lib/dateedit.h index 031a96741..c7c015785 100644 --- a/kalarm/lib/dateedit.h +++ b/kalarm/lib/dateedit.h @@ -42,49 +42,49 @@ class DateEdit : public KDateEdit * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit DateEdit(QWidget* parent = 0, const char* name = 0); + explicit DateEdit(TQWidget* parent = 0, const char* name = 0); /** Returns true if the widget contains a valid date. */ bool isValid() const { return date().isValid(); } /** Returns the earliest date which can be entered. * If there is no minimum date, returns an invalid date. */ - const QDate& minDate() const { return mMinDate; } + const TQDate& minDate() const { return mMinDate; } /** Returns the latest date which can be entered. * If there is no maximum date, returns an invalid date. */ - const QDate& maxDate() const { return mMaxDate; } + const TQDate& maxDate() const { return mMaxDate; } /** Sets the earliest date which can be entered. * @param date Earliest date allowed. If invalid, any minimum limit is removed. * @param errorDate Error message to be displayed when a date earlier than - * @p date is entered. Set to QString::null to use the default error message. + * @p date is entered. Set to TQString::null to use the default error message. */ - void setMinDate(const QDate& date, const QString& errorDate = QString::null); + void setMinDate(const TQDate& date, const TQString& errorDate = TQString::null); /** Sets the latest date which can be entered. * @param date Latest date allowed. If invalid, any maximum limit is removed. * @param errorDate Error message to be displayed when a date later than - * @p date is entered. Set to QString::null to use the default error message. + * @p date is entered. Set to TQString::null to use the default error message. */ - void setMaxDate(const QDate& date, const QString& errorDate = QString::null); + void setMaxDate(const TQDate& date, const TQString& errorDate = TQString::null); /** Sets the date held in the widget to an invalid date. */ void setInvalid(); protected: - virtual void mousePressEvent(QMouseEvent*); - virtual void mouseReleaseEvent(QMouseEvent*); - virtual void mouseMoveEvent(QMouseEvent*); - virtual void keyPressEvent(QKeyEvent*); - virtual void keyReleaseEvent(QKeyEvent*); + virtual void mousePressEvent(TQMouseEvent*); + virtual void mouseReleaseEvent(TQMouseEvent*); + virtual void mouseMoveEvent(TQMouseEvent*); + virtual void keyPressEvent(TQKeyEvent*); + virtual void keyReleaseEvent(TQKeyEvent*); private slots: - void newDateEntered(const QDate&); + void newDateEntered(const TQDate&); private: - void pastLimitMessage(const QDate& limit, const QString& error, const QString& defaultError); + void pastLimitMessage(const TQDate& limit, const TQString& error, const TQString& defaultError); - QDate mMinDate; // minimum allowed date, or invalid for no minimum - QDate mMaxDate; // maximum allowed date, or invalid for no maximum - QString mMinDateErrString; // error message when entered date < mMinDate - QString mMaxDateErrString; // error message when entered date > mMaxDate + TQDate mMinDate; // minimum allowed date, or invalid for no minimum + TQDate mMaxDate; // maximum allowed date, or invalid for no maximum + TQString mMinDateErrString; // error message when entered date < mMinDate + TQString mMaxDateErrString; // error message when entered date > mMaxDate }; #endif // DATEEDIT_H diff --git a/kalarm/lib/datetime.cpp b/kalarm/lib/datetime.cpp index d7f5ee862..3ebaccd30 100644 --- a/kalarm/lib/datetime.cpp +++ b/kalarm/lib/datetime.cpp @@ -24,26 +24,26 @@ #include "datetime.h" -QTime DateTime::mStartOfDay; +TQTime DateTime::mStartOfDay; -QTime DateTime::time() const +TQTime DateTime::time() const { return mDateOnly ? mStartOfDay : mDateTime.time(); } -QDateTime DateTime::dateTime() const +TQDateTime DateTime::dateTime() const { - return mDateOnly ? QDateTime(mDateTime.date(), mStartOfDay) : mDateTime; + return mDateOnly ? TQDateTime(mDateTime.date(), mStartOfDay) : mDateTime; } -QString DateTime::formatLocale(bool shortFormat) const +TQString DateTime::formatLocale(bool shortFormat) const { if (mDateOnly) return KGlobal::locale()->formatDate(mDateTime.date(), shortFormat); else if (mTimeValid) return KGlobal::locale()->formatDateTime(mDateTime, shortFormat); else - return QString::null; + return TQString::null; } bool operator==(const DateTime& dt1, const DateTime& dt2) @@ -73,7 +73,7 @@ bool operator<(const DateTime& dt1, const DateTime& dt2) return false; if (!dt1.mDateOnly && !dt2.mDateOnly) return dt1.mDateTime.time() < dt2.mDateTime.time(); - QTime t = DateTime::startOfDay(); + TQTime t = DateTime::startOfDay(); if (dt1.mDateOnly) return t < dt2.mDateTime.time(); return dt1.mDateTime.time() < t; diff --git a/kalarm/lib/datetime.h b/kalarm/lib/datetime.h index 3b0831918..eb40d6b5c 100644 --- a/kalarm/lib/datetime.h +++ b/kalarm/lib/datetime.h @@ -20,15 +20,15 @@ #ifndef DATETIME_H #define DATETIME_H -#include <qdatetime.h> +#include <tqdatetime.h> /** - * @short A QDateTime with date-only option. + * @short A TQDateTime with date-only option. * * The DateTime class holds a date, with or without a time. * - * DateTime is very similar to the QDateTime class, with the additional option to + * DateTime is very similar to the TQDateTime class, with the additional option to * hold a date-only value. This allows a single date-time representation to be used * for both an event having a specific date and time, and an all-day event. * @@ -44,17 +44,17 @@ class DateTime */ DateTime() : mDateOnly(false), mTimeValid(false) { } /** Constructor for a date-only value. */ - DateTime(const QDate& d) : mDateTime(d), mDateOnly(true) { } + DateTime(const TQDate& d) : mDateTime(d), mDateOnly(true) { } /** Constructor for a date-time value. */ - DateTime(const QDate& d, const QTime& t) + DateTime(const TQDate& d, const TQTime& t) : mDateTime(d, t), mDateOnly(false), mTimeValid(true) { } /** Constructor for a date-time or date-only value. * @param dt the date and time to use. * @param dateOnly True to construct a date-only value; false to construct a date-time value. */ - DateTime(const QDateTime& dt, bool dateOnly = false) + DateTime(const TQDateTime& dt, bool dateOnly = false) : mDateTime(dt), mDateOnly(dateOnly), mTimeValid(true) - { if (dateOnly) mDateTime.setTime(QTime()); } + { if (dateOnly) mDateTime.setTime(TQTime()); } /** Assignment operator. * Sets the value to a specified date-time or date-only value. */ @@ -63,13 +63,13 @@ class DateTime /** Assignment operator. * Sets the value to a specified date-time. */ - DateTime& operator=(const QDateTime& dt) + DateTime& operator=(const TQDateTime& dt) { mDateTime = dt; mDateOnly = false; mTimeValid = true; return *this; } /** Assignment operator. * Sets the value to a specified date-only value. */ - DateTime& operator=(const QDate& d) - { mDateTime.setDate(d); mDateTime.setTime(QTime()); mDateOnly = true; return *this; } + DateTime& operator=(const TQDate& d) + { mDateTime.setDate(d); mDateTime.setTime(TQTime()); mDateOnly = true; return *this; } /** Returns true if the date is null and, if it is a date-time value, the time is also null. */ bool isNull() const { return mDateTime.date().isNull() && (mDateOnly || mDateTime.time().isNull()); } /** Returns true if the date is valid and, if it is a date-time value, the time is also valid. */ @@ -79,44 +79,44 @@ class DateTime /** Sets the value to be either date-only or date-time. * @param d True to set the value to be date-only; false to set it to a date-time value. */ - void setDateOnly(bool d) { if (d) mDateTime.setTime(QTime()); + void setDateOnly(bool d) { if (d) mDateTime.setTime(TQTime()); else if (mDateOnly) mTimeValid = false; mDateOnly = d; } /** Returns the date part of the value. */ - QDate date() const { return mDateTime.date(); } + TQDate date() const { return mDateTime.date(); } /** Returns the time part of the value. * If the value is date-only, the time returned is the start-of-day time set by setStartOfDay(). */ - QTime time() const; + TQTime time() const; /** Returns the date and time of the value. * If the value is date-only, the time part returned is equal to the start-of-day time set * by setStartOfDay(). */ - QDateTime dateTime() const; + TQDateTime dateTime() const; /** Returns the date and time of the value. * if the value is date-only, the time part returned is 00:00:00. */ - QDateTime rawDateTime() const { return mDateTime; } + TQDateTime rawDateTime() const { return mDateTime; } /** Sets a date-time or date-only value. * @param dt the date-time to use. * @param dateOnly True to set a date-only value; false to set a date-time value. */ - void set(const QDateTime& dt, bool dateOnly = false) + void set(const TQDateTime& dt, bool dateOnly = false) { mDateTime = dt; mDateOnly = dateOnly; if (dateOnly) - mDateTime.setTime(QTime()); + mDateTime.setTime(TQTime()); mTimeValid = true; } /** Sets a date-time value. */ - void set(const QDate& d, const QTime& t) + void set(const TQDate& d, const TQTime& t) { mDateTime.setDate(d); mDateTime.setTime(t); mDateOnly = false; mTimeValid = true; } /** Sets the time component of the value. * The value is converted if necessary to be a date-time value. */ - void setTime(const QTime& t) { mDateTime.setTime(t); mDateOnly = false; mTimeValid = true; } + void setTime(const TQTime& t) { mDateTime.setTime(t); mDateOnly = false; mTimeValid = true; } /** Sets the value to a specified date-time value. * @param secs The time_t date-time value, expressed as the number of seconds elapsed * since 1970-01-01 00:00:00 UTC. @@ -169,46 +169,46 @@ class DateTime * If it is a date-time, both time and date are included in the output. * If it is date-only, only the date is included in the output. */ - QString toString(Qt::DateFormat f = Qt::TextDate) const + TQString toString(Qt::DateFormat f = Qt::TextDate) const { if (mDateOnly) return mDateTime.date().toString(f); else if (mTimeValid) return mDateTime.toString(f); else - return QString::null; + return TQString::null; } /** Returns the value as a string. * If it is a date-time, both time and date are included in the output. * If it is date-only, only the date is included in the output. */ - QString toString(const QString& format) const + TQString toString(const TQString& format) const { if (mDateOnly) return mDateTime.date().toString(format); else if (mTimeValid) return mDateTime.toString(format); else - return QString::null; + return TQString::null; } /** Returns the value as a string, formatted according to the user's locale. * If it is a date-time, both time and date are included in the output. * If it is date-only, only the date is included in the output. */ - QString formatLocale(bool shortFormat = true) const; + TQString formatLocale(bool shortFormat = true) const; /** Sets the start-of-day time. * The default value is midnight (0000 hrs). */ - static void setStartOfDay(const QTime& sod) { mStartOfDay = sod; } + static void setStartOfDay(const TQTime& sod) { mStartOfDay = sod; } /** Returns the start-of-day time. */ - static QTime startOfDay() { return mStartOfDay; } + static TQTime startOfDay() { return mStartOfDay; } friend bool operator==(const DateTime& dt1, const DateTime& dt2); friend bool operator<(const DateTime& dt1, const DateTime& dt2); private: - static QTime mStartOfDay; - QDateTime mDateTime; + static TQTime mStartOfDay; + TQDateTime mDateTime; bool mDateOnly; bool mTimeValid; // whether the time is potentially valid - applicable only if mDateOnly false }; diff --git a/kalarm/lib/label.cpp b/kalarm/lib/label.cpp index c61ce76ad..69cef7544 100644 --- a/kalarm/lib/label.cpp +++ b/kalarm/lib/label.cpp @@ -19,24 +19,24 @@ */ #include "kalarm.h" -#include <qradiobutton.h> +#include <tqradiobutton.h> #include "label.moc" -Label::Label(QWidget* parent, const char* name, WFlags f) - : QLabel(parent, name, f), +Label::Label(TQWidget* parent, const char* name, WFlags f) + : TQLabel(parent, name, f), mRadioButton(0), mFocusWidget(0) { } -Label::Label(const QString& text, QWidget* parent, const char* name, WFlags f) - : QLabel(text, parent, name, f), +Label::Label(const TQString& text, TQWidget* parent, const char* name, WFlags f) + : TQLabel(text, parent, name, f), mRadioButton(0), mFocusWidget(0) { } -Label::Label(QWidget* buddy, const QString& text, QWidget* parent, const char* name, WFlags f) - : QLabel(buddy, text, parent, name, f), +Label::Label(TQWidget* buddy, const TQString& text, TQWidget* parent, const char* name, WFlags f) + : TQLabel(buddy, text, parent, name, f), mRadioButton(0), mFocusWidget(0) { } @@ -47,22 +47,22 @@ Label::Label(QWidget* buddy, const QString& text, QWidget* parent, const char* n * When the accelerator key is pressed, the focus widget then receives focus. * That event triggers the selection of the radio button. */ -void Label::setBuddy(QWidget* bud) +void Label::setBuddy(TQWidget* bud) { if (mRadioButton) - disconnect(mRadioButton, SIGNAL(destroyed()), this, SLOT(buddyDead())); - QWidget* w = bud; + disconnect(mRadioButton, TQT_SIGNAL(destroyed()), this, TQT_SLOT(buddyDead())); + TQWidget* w = bud; if (w) { while (w->focusProxy()) w = w->focusProxy(); - if (!w->inherits("QRadioButton")) + if (!w->inherits("TQRadioButton")) w = 0; } if (!w) { // The buddy widget isn't a radio button - QLabel::setBuddy(bud); + TQLabel::setBuddy(bud); delete mFocusWidget; mFocusWidget = 0; mRadioButton = 0; @@ -72,9 +72,9 @@ void Label::setBuddy(QWidget* bud) // The buddy widget is a radio button, so set a different buddy if (!mFocusWidget) mFocusWidget = new LabelFocusWidget(this); - QLabel::setBuddy(mFocusWidget); - mRadioButton = (QRadioButton*)bud; - connect(mRadioButton, SIGNAL(destroyed()), this, SLOT(buddyDead())); + TQLabel::setBuddy(mFocusWidget); + mRadioButton = (TQRadioButton*)bud; + connect(mRadioButton, TQT_SIGNAL(destroyed()), this, TQT_SLOT(buddyDead())); } } @@ -103,14 +103,14 @@ void Label::activated() * Class: LabelFocusWidget =============================================================================*/ -LabelFocusWidget::LabelFocusWidget(QWidget* parent, const char* name) - : QWidget(parent, name) +LabelFocusWidget::LabelFocusWidget(TQWidget* parent, const char* name) + : TQWidget(parent, name) { setFocusPolicy(ClickFocus); - setFixedSize(QSize(1,1)); + setFixedSize(TQSize(1,1)); } -void LabelFocusWidget::focusInEvent(QFocusEvent*) +void LabelFocusWidget::focusInEvent(TQFocusEvent*) { Label* parent = (Label*)parentWidget(); parent->activated(); diff --git a/kalarm/lib/label.h b/kalarm/lib/label.h index c65a7fcd6..4c0d74216 100644 --- a/kalarm/lib/label.h +++ b/kalarm/lib/label.h @@ -21,12 +21,12 @@ #ifndef LABEL_H #define LABEL_H -#include <qlabel.h> +#include <tqlabel.h> class QRadioButton; class LabelFocusWidget; /** - * @short A QLabel with option for a buddy radio button. + * @short A TQLabel with option for a buddy radio button. * * The Label class provides a text display, with special behaviour when a radio * button is set as a buddy. @@ -34,7 +34,7 @@ class LabelFocusWidget; * The Label object in effect acts as if it were part of the buddy radio button, * in that when the label's accelerator key is pressed, the radio button receives * focus and is switched on. When a non-radio button is specified as a buddy, the - * behaviour is the same as for QLabel. + * behaviour is the same as for TQLabel. * * @author David Jarvie <software@astrojar.org.uk> */ @@ -46,16 +46,16 @@ class Label : public QLabel /** Constructs an empty label. * @param parent The parent object of this widget. * @param name The name of this widget. - * @param f Flags. See QWidget constructor for details. + * @param f Flags. See TQWidget constructor for details. */ - explicit Label(QWidget* parent, const char* name = 0, WFlags f = 0); + explicit Label(TQWidget* parent, const char* name = 0, WFlags f = 0); /** Constructs a label that displays @p text. * @param text Text string to display. * @param parent The parent object of this widget. * @param name The name of this widget. - * @param f Flags. See QWidget constructor for details. + * @param f Flags. See TQWidget constructor for details. */ - Label(const QString& text, QWidget* parent, const char* name = 0, WFlags f = 0); + Label(const TQString& text, TQWidget* parent, const char* name = 0, WFlags f = 0); /** Constructs a label, with a buddy widget, that displays @p text. * @param buddy Buddy widget which receives the keyboard focus when the * label's accelerator key is pressed. If @p buddy is a radio @@ -64,21 +64,21 @@ class Label : public QLabel * @param text Text string to display. * @param parent The parent object of this widget. * @param name The name of this widget. - * @param f Flags. See QWidget constructor for details. + * @param f Flags. See TQWidget constructor for details. */ - Label(QWidget* buddy, const QString& text, QWidget* parent, const char* name = 0, WFlags f = 0); + Label(TQWidget* buddy, const TQString& text, TQWidget* parent, const char* name = 0, WFlags f = 0); /** Sets the label's buddy widget which receives the keyboard focus when the * label's accelerator key is pressed. If @p buddy is a radio button, * @p buddy is in addition selected when the accelerator key is pressed. */ - virtual void setBuddy(QWidget* buddy); + virtual void setBuddy(TQWidget* buddy); protected: - virtual void drawContents(QPainter* p) { QLabel::drawContents(p); } + virtual void drawContents(TQPainter* p) { TQLabel::drawContents(p); } private slots: void buddyDead(); private: void activated(); - QRadioButton* mRadioButton; // buddy widget if it's a radio button, else 0 + TQRadioButton* mRadioButton; // buddy widget if it's a radio button, else 0 LabelFocusWidget* mFocusWidget; }; @@ -88,9 +88,9 @@ class LabelFocusWidget : public QWidget { Q_OBJECT public: - LabelFocusWidget(QWidget* parent, const char* name = 0); + LabelFocusWidget(TQWidget* parent, const char* name = 0); protected: - virtual void focusInEvent(QFocusEvent*); + virtual void focusInEvent(TQFocusEvent*); }; #endif // LABEL_H diff --git a/kalarm/lib/lineedit.cpp b/kalarm/lib/lineedit.cpp index 943d7b2d0..64c79ea7b 100644 --- a/kalarm/lib/lineedit.cpp +++ b/kalarm/lib/lineedit.cpp @@ -20,8 +20,8 @@ #include "kalarm.h" -#include <qregexp.h> -#include <qdragobject.h> +#include <tqregexp.h> +#include <tqdragobject.h> #include <kurldrag.h> #include <kurlcompletion.h> @@ -39,7 +39,7 @@ * It has an option to prevent its contents being selected when it receives = focus. =============================================================================*/ -LineEdit::LineEdit(Type type, QWidget* parent, const char* name) +LineEdit::LineEdit(Type type, TQWidget* parent, const char* name) : KLineEdit(parent, name), mType(type), mNoSelect(false), @@ -48,7 +48,7 @@ LineEdit::LineEdit(Type type, QWidget* parent, const char* name) init(); } -LineEdit::LineEdit(QWidget* parent, const char* name) +LineEdit::LineEdit(TQWidget* parent, const char* name) : KLineEdit(parent, name), mType(Text), mNoSelect(false), @@ -75,39 +75,39 @@ void LineEdit::init() * Called when the line edit receives focus. * If 'noSelect' is true, prevent the contents being selected. */ -void LineEdit::focusInEvent(QFocusEvent* e) +void LineEdit::focusInEvent(TQFocusEvent* e) { if (mNoSelect) - QFocusEvent::setReason(QFocusEvent::Other); + TQFocusEvent::setReason(TQFocusEvent::Other); KLineEdit::focusInEvent(e); if (mNoSelect) { - QFocusEvent::resetReason(); + TQFocusEvent::resetReason(); mNoSelect = false; } } -void LineEdit::setText(const QString& text) +void LineEdit::setText(const TQString& text) { KLineEdit::setText(text); setCursorPosition(mSetCursorAtEnd ? text.length() : 0); } -void LineEdit::dragEnterEvent(QDragEnterEvent* e) +void LineEdit::dragEnterEvent(TQDragEnterEvent* e) { if (KCal::ICalDrag::canDecode(e)) e->accept(false); // don't accept "text/calendar" objects - e->accept(QTextDrag::canDecode(e) + e->accept(TQTextDrag::canDecode(e) || KURLDrag::canDecode(e) || mType != Url && KPIM::MailListDrag::canDecode(e) || mType == Emails && KVCardDrag::canDecode(e)); } -void LineEdit::dropEvent(QDropEvent* e) +void LineEdit::dropEvent(TQDropEvent* e) { - QString newText; - QStringList newEmails; - QString txt; + TQString newText; + TQStringList newEmails; + TQString txt; KPIM::MailList mailList; KURL::List files; KABC::Addressee::List addrList; @@ -132,7 +132,7 @@ void LineEdit::dropEvent(QDropEvent* e) // KAddressBook entries for (KABC::Addressee::List::Iterator it = addrList.begin(); it != addrList.end(); ++it) { - QString em((*it).fullEmail()); + TQString em((*it).fullEmail()); if (!em.isEmpty()) newEmails.append(em); } @@ -149,7 +149,7 @@ void LineEdit::dropEvent(QDropEvent* e) case Emails: { // Email entry field - ignore all but mailto: URLs - QString mailto = QString::fromLatin1("mailto"); + TQString mailto = TQString::fromLatin1("mailto"); for (KURL::List::Iterator it = files.begin(); it != files.end(); ++it) { if ((*it).protocol() == mailto) @@ -162,15 +162,15 @@ void LineEdit::dropEvent(QDropEvent* e) break; } } - else if (QTextDrag::decode(e, txt)) + else if (TQTextDrag::decode(e, txt)) { // Plain text if (mType == Emails) { // Remove newlines from a list of email addresses, and allow an eventual mailto: protocol - QString mailto = QString::fromLatin1("mailto:"); - newEmails = QStringList::split(QRegExp("[\r\n]+"), txt); - for (QStringList::Iterator it = newEmails.begin(); it != newEmails.end(); ++it) + TQString mailto = TQString::fromLatin1("mailto:"); + newEmails = TQStringList::split(TQRegExp("[\r\n]+"), txt); + for (TQStringList::Iterator it = newEmails.begin(); it != newEmails.end(); ++it) { if ((*it).startsWith(mailto)) { diff --git a/kalarm/lib/lineedit.h b/kalarm/lib/lineedit.h index 57f8378ee..612b12a33 100644 --- a/kalarm/lib/lineedit.h +++ b/kalarm/lib/lineedit.h @@ -64,12 +64,12 @@ class LineEdit : public KLineEdit * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit LineEdit(Type type, QWidget* parent = 0, const char* name = 0); + explicit LineEdit(Type type, TQWidget* parent = 0, const char* name = 0); /** Constructs a line edit whose content type is Text. * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit LineEdit(QWidget* parent = 0, const char* name = 0); + explicit LineEdit(TQWidget* parent = 0, const char* name = 0); /** Prevents the line edit's contents being selected when the widget receives focus. */ void setNoSelect() { mNoSelect = true; } /** Sets whether the cursor should be set at the beginning or end of the text when @@ -78,11 +78,11 @@ class LineEdit : public KLineEdit void setCursorAtEnd(bool end = true) { mSetCursorAtEnd = end; } public slots: /** Sets the contents of the line edit to be @p str. */ - virtual void setText(const QString& str); + virtual void setText(const TQString& str); protected: - virtual void focusInEvent(QFocusEvent*); - virtual void dragEnterEvent(QDragEnterEvent*); - virtual void dropEvent(QDropEvent*); + virtual void focusInEvent(TQFocusEvent*); + virtual void dragEnterEvent(TQDragEnterEvent*); + virtual void dropEvent(TQDropEvent*); private: void init(); diff --git a/kalarm/lib/messagebox.cpp b/kalarm/lib/messagebox.cpp index 514b45bc2..48c18f1cd 100644 --- a/kalarm/lib/messagebox.cpp +++ b/kalarm/lib/messagebox.cpp @@ -24,14 +24,14 @@ KConfig* MessageBox::mConfig = 0; -QMap<QString, KMessageBox::ButtonCode> MessageBox::mContinueDefaults; +TQMap<TQString, KMessageBox::ButtonCode> MessageBox::mContinueDefaults; /****************************************************************************** * Set the default button for continue/cancel message boxes with the specified * 'dontAskAgainName'. */ -void MessageBox::setContinueDefault(const QString& dontAskAgainName, ButtonCode defaultButton) +void MessageBox::setContinueDefault(const TQString& dontAskAgainName, ButtonCode defaultButton) { mContinueDefaults[dontAskAgainName] = (defaultButton == Cancel ? Cancel : Continue); } @@ -40,12 +40,12 @@ void MessageBox::setContinueDefault(const QString& dontAskAgainName, ButtonCode * Get the default button for continue/cancel message boxes with the specified * 'dontAskAgainName'. */ -KMessageBox::ButtonCode MessageBox::getContinueDefault(const QString& dontAskAgainName) +KMessageBox::ButtonCode MessageBox::getContinueDefault(const TQString& dontAskAgainName) { ButtonCode defaultButton = Continue; if (!dontAskAgainName.isEmpty()) { - QMap<QString, ButtonCode>::ConstIterator it = mContinueDefaults.find(dontAskAgainName); + TQMap<TQString, ButtonCode>::ConstIterator it = mContinueDefaults.find(dontAskAgainName); if (it != mContinueDefaults.end()) defaultButton = it.data(); } @@ -60,8 +60,8 @@ KMessageBox::ButtonCode MessageBox::getContinueDefault(const QString& dontAskAga * warningContinueCancel() for that 'dontAskAgainName' value. If neither method * has set a default button, Continue is the default. */ -int MessageBox::warningContinueCancel(QWidget* parent, const QString& text, const QString& caption, - const KGuiItem& buttonContinue, const QString& dontAskAgainName) +int MessageBox::warningContinueCancel(TQWidget* parent, const TQString& text, const TQString& caption, + const KGuiItem& buttonContinue, const TQString& dontAskAgainName) { ButtonCode defaultButton = getContinueDefault(dontAskAgainName); return warningContinueCancel(parent, defaultButton, text, caption, buttonContinue, dontAskAgainName); @@ -72,9 +72,9 @@ int MessageBox::warningContinueCancel(QWidget* parent, const QString& text, cons * If 'dontAskAgainName' is specified, the message box will only be suppressed * if the user chose Continue last time. */ -int MessageBox::warningContinueCancel(QWidget* parent, ButtonCode defaultButton, const QString& text, - const QString& caption, const KGuiItem& buttonContinue, - const QString& dontAskAgainName) +int MessageBox::warningContinueCancel(TQWidget* parent, ButtonCode defaultButton, const TQString& text, + const TQString& caption, const KGuiItem& buttonContinue, + const TQString& dontAskAgainName) { setContinueDefault(dontAskAgainName, defaultButton); if (defaultButton != Cancel) @@ -103,13 +103,13 @@ int MessageBox::warningContinueCancel(QWidget* parent, ButtonCode defaultButton, * previously to set this for this 'dontShowAgainName' value. * Reply = true if 'defaultShow' was written. */ -bool MessageBox::setDefaultShouldBeShownContinue(const QString& dontShowAgainName, bool defaultShow) +bool MessageBox::setDefaultShouldBeShownContinue(const TQString& dontShowAgainName, bool defaultShow) { if (dontShowAgainName.isEmpty()) return false; // First check whether there is an existing setting KConfig* config = mConfig ? mConfig : KGlobal::config(); - config->setGroup(QString::fromLatin1("Notification Messages")); + config->setGroup(TQString::fromLatin1("Notification Messages")); if (config->hasKey(dontShowAgainName)) return false; @@ -124,7 +124,7 @@ bool MessageBox::setDefaultShouldBeShownContinue(const QString& dontShowAgainNam * or warningContinueCancel() must have been called previously to set this for this * 'dontShowAgainName' value. */ -bool MessageBox::shouldBeShownContinue(const QString& dontShowAgainName) +bool MessageBox::shouldBeShownContinue(const TQString& dontShowAgainName) { if (getContinueDefault(dontShowAgainName) != Cancel) return KMessageBox::shouldBeShownContinue(dontShowAgainName); @@ -139,7 +139,7 @@ bool MessageBox::shouldBeShownContinue(const QString& dontShowAgainName) * If 'dontShow' is true, the message box will be suppressed and it will return * 'result'. */ -void MessageBox::saveDontShowAgainYesNo(const QString& dontShowAgainName, bool dontShow, ButtonCode result) +void MessageBox::saveDontShowAgainYesNo(const TQString& dontShowAgainName, bool dontShow, ButtonCode result) { saveDontShowAgain(dontShowAgainName, true, dontShow, (result == Yes ? "yes" : "no")); } @@ -152,7 +152,7 @@ void MessageBox::saveDontShowAgainYesNo(const QString& dontShowAgainName, bool d * or warningContinueCancel() must have been called previously to set this for this * 'dontShowAgainName' value. */ -void MessageBox::saveDontShowAgainContinue(const QString& dontShowAgainName, bool dontShow) +void MessageBox::saveDontShowAgainContinue(const TQString& dontShowAgainName, bool dontShow) { if (getContinueDefault(dontShowAgainName) == Cancel) saveDontShowAgainYesNo(dontShowAgainName, dontShow, Yes); @@ -163,15 +163,15 @@ void MessageBox::saveDontShowAgainContinue(const QString& dontShowAgainName, boo /****************************************************************************** * Save whether the message box should not be shown again. */ -void MessageBox::saveDontShowAgain(const QString& dontShowAgainName, bool yesno, bool dontShow, const char* yesnoResult) +void MessageBox::saveDontShowAgain(const TQString& dontShowAgainName, bool yesno, bool dontShow, const char* yesnoResult) { if (dontShowAgainName.isEmpty()) return; KConfig* config = mConfig ? mConfig : KGlobal::config(); - config->setGroup(QString::fromLatin1("Notification Messages")); + config->setGroup(TQString::fromLatin1("Notification Messages")); bool global = (dontShowAgainName[0] == ':'); if (yesno) - config->writeEntry(dontShowAgainName, QString::fromLatin1(dontShow ? yesnoResult : ""), true, global); + config->writeEntry(dontShowAgainName, TQString::fromLatin1(dontShow ? yesnoResult : ""), true, global); else config->writeEntry(dontShowAgainName, !dontShow, true, global); config->sync(); diff --git a/kalarm/lib/messagebox.h b/kalarm/lib/messagebox.h index 32e0d7325..6d65b0934 100644 --- a/kalarm/lib/messagebox.h +++ b/kalarm/lib/messagebox.h @@ -50,13 +50,13 @@ class MessageBox : public KMessageBox * "don't ask again" name. * @param dontAskAgainName The identifier controlling whether the message box is suppressed. */ - static ButtonCode getContinueDefault(const QString& dontAskAgainName); + static ButtonCode getContinueDefault(const TQString& dontAskAgainName); /** Sets the default button for the Continue/Cancel message box with the specified * "don't ask again" name. * @param dontAskAgainName The identifier controlling whether the message box is suppressed. * @param defaultButton The default button for the message box. Valid values are Continue or Cancel. */ - static void setContinueDefault(const QString& dontAskAgainName, ButtonCode defaultButton); + static void setContinueDefault(const TQString& dontAskAgainName, ButtonCode defaultButton); /** Displays a Continue/Cancel message box with the option as to which button is the default. * @param parent Parent widget * @param defaultButton The default button for the message box. Valid values are Continue or Cancel. @@ -66,10 +66,10 @@ class MessageBox : public KMessageBox * @param dontAskAgainName If specified, the message box will only be suppressed * if the user chose Continue last time. */ - static int warningContinueCancel(QWidget* parent, ButtonCode defaultButton, const QString& text, - const QString& caption = QString::null, + static int warningContinueCancel(TQWidget* parent, ButtonCode defaultButton, const TQString& text, + const TQString& caption = TQString::null, const KGuiItem& buttonContinue = KStdGuiItem::cont(), - const QString& dontAskAgainName = QString::null); + const TQString& dontAskAgainName = TQString::null); /** Displays a Continue/Cancel message box. * @param parent Parent widget * @param text Message string @@ -81,9 +81,9 @@ class MessageBox : public KMessageBox * @p dontAskAgainName value. If neither method has been used to set a default button, * Continue is the default. */ - static int warningContinueCancel(QWidget* parent, const QString& text, const QString& caption = QString::null, + static int warningContinueCancel(TQWidget* parent, const TQString& text, const TQString& caption = TQString::null, const KGuiItem& buttonContinue = KStdGuiItem::cont(), - const QString& dontAskAgainName = QString::null); + const TQString& dontAskAgainName = TQString::null); /** If there is no current setting for whether a non-Yes/No message box should be * shown, sets it to @p defaultShow. * If a Continue/Cancel message box has Cancel as the default button, either @@ -91,20 +91,20 @@ class MessageBox : public KMessageBox * previously to set this for the specified @p dontShowAgainName value. * @return true if @p defaultShow was written. */ - static bool setDefaultShouldBeShownContinue(const QString& dontShowAgainName, bool defaultShow); + static bool setDefaultShouldBeShownContinue(const TQString& dontShowAgainName, bool defaultShow); /** Returns whether a non-Yes/No message box should be shown. * If the message box has Cancel as the default button, either setContinueDefault() * or warningContinueCancel() must have been called previously to set this for the * specified @p dontShowAgainName value. * @param dontShowAgainName The identifier controlling whether the message box is suppressed. */ - static bool shouldBeShownContinue(const QString& dontShowAgainName); + static bool shouldBeShownContinue(const TQString& dontShowAgainName); /** Stores whether the Yes/No message box should or should not be shown again. * @param dontShowAgainName The identifier controlling whether the message box is suppressed. * @param dontShow If true, the message box will be suppressed and will return @p result. * @param result The button code to return if the message box is suppressed. */ - static void saveDontShowAgainYesNo(const QString& dontShowAgainName, bool dontShow = true, ButtonCode result = No); + static void saveDontShowAgainYesNo(const TQString& dontShowAgainName, bool dontShow = true, ButtonCode result = No); /** Stores whether a non-Yes/No message box should or should not be shown again. * If the message box has Cancel as the default button, either setContinueDefault() * or warningContinueCancel() must have been called previously to set this for the @@ -112,14 +112,14 @@ class MessageBox : public KMessageBox * @param dontShowAgainName The identifier controlling whether the message box is suppressed. * @param dontShow If true, the message box will be suppressed and will return Continue. */ - static void saveDontShowAgainContinue(const QString& dontShowAgainName, bool dontShow = true); + static void saveDontShowAgainContinue(const TQString& dontShowAgainName, bool dontShow = true); /** Sets the KConfig object to be used by the MessageBox class. */ static void setDontShowAskAgainConfig(KConfig* cfg) { mConfig = cfg; } private: - static void saveDontShowAgain(const QString& dontShowAgainName, bool yesno, bool dontShow, const char* yesnoResult = 0); + static void saveDontShowAgain(const TQString& dontShowAgainName, bool yesno, bool dontShow, const char* yesnoResult = 0); static KConfig* mConfig; - static QMap<QString, ButtonCode> mContinueDefaults; + static TQMap<TQString, ButtonCode> mContinueDefaults; }; #endif diff --git a/kalarm/lib/pushbutton.cpp b/kalarm/lib/pushbutton.cpp index 8b279082c..ed8440a05 100644 --- a/kalarm/lib/pushbutton.cpp +++ b/kalarm/lib/pushbutton.cpp @@ -21,20 +21,20 @@ #include "pushbutton.moc" -PushButton::PushButton(QWidget* parent, const char* name) - : QPushButton(parent, name), +PushButton::PushButton(TQWidget* parent, const char* name) + : TQPushButton(parent, name), mFocusPolicy(focusPolicy()), mReadOnly(false) { } -PushButton::PushButton(const QString& text, QWidget* parent, const char* name) - : QPushButton(text, parent, name), +PushButton::PushButton(const TQString& text, TQWidget* parent, const char* name) + : TQPushButton(text, parent, name), mFocusPolicy(focusPolicy()), mReadOnly(false) { } -PushButton::PushButton(const QIconSet& icon, const QString& text, QWidget* parent, const char* name) - : QPushButton(icon, text, parent, name), +PushButton::PushButton(const TQIconSet& icon, const TQString& text, TQWidget* parent, const char* name) + : TQPushButton(icon, text, parent, name), mFocusPolicy(focusPolicy()), mReadOnly(false) { } @@ -44,13 +44,13 @@ void PushButton::setReadOnly(bool ro) if ((int)ro != (int)mReadOnly) { mReadOnly = ro; - setFocusPolicy(ro ? QWidget::NoFocus : mFocusPolicy); + setFocusPolicy(ro ? TQWidget::NoFocus : mFocusPolicy); if (ro) clearFocus(); } } -void PushButton::mousePressEvent(QMouseEvent* e) +void PushButton::mousePressEvent(TQMouseEvent* e) { if (mReadOnly) { @@ -58,10 +58,10 @@ void PushButton::mousePressEvent(QMouseEvent* e) if (e->button() == Qt::LeftButton) return; } - QPushButton::mousePressEvent(e); + TQPushButton::mousePressEvent(e); } -void PushButton::mouseReleaseEvent(QMouseEvent* e) +void PushButton::mouseReleaseEvent(TQMouseEvent* e) { if (mReadOnly) { @@ -69,16 +69,16 @@ void PushButton::mouseReleaseEvent(QMouseEvent* e) if (e->button() == Qt::LeftButton) return; } - QPushButton::mouseReleaseEvent(e); + TQPushButton::mouseReleaseEvent(e); } -void PushButton::mouseMoveEvent(QMouseEvent* e) +void PushButton::mouseMoveEvent(TQMouseEvent* e) { if (!mReadOnly) - QPushButton::mouseMoveEvent(e); + TQPushButton::mouseMoveEvent(e); } -void PushButton::keyPressEvent(QKeyEvent* e) +void PushButton::keyPressEvent(TQKeyEvent* e) { if (mReadOnly) switch (e->key()) @@ -92,11 +92,11 @@ void PushButton::keyPressEvent(QKeyEvent* e) default: return; } - QPushButton::keyPressEvent(e); + TQPushButton::keyPressEvent(e); } -void PushButton::keyReleaseEvent(QKeyEvent* e) +void PushButton::keyReleaseEvent(TQKeyEvent* e) { if (!mReadOnly) - QPushButton::keyReleaseEvent(e); + TQPushButton::keyReleaseEvent(e); } diff --git a/kalarm/lib/pushbutton.h b/kalarm/lib/pushbutton.h index 6ef0f3a2a..8d82ac96e 100644 --- a/kalarm/lib/pushbutton.h +++ b/kalarm/lib/pushbutton.h @@ -21,13 +21,13 @@ #ifndef PUSHBUTTON_H #define PUSHBUTTON_H -#include <qpushbutton.h> +#include <tqpushbutton.h> /** - * @short A QPushButton with read-only option. + * @short A TQPushButton with read-only option. * - * The PushButton class is a QPushButton with a read-only option. + * The PushButton class is a TQPushButton with a read-only option. * * The widget may be set as read-only. This has the same effect as disabling it, except * that its appearance is unchanged. @@ -43,20 +43,20 @@ class PushButton : public QPushButton * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit PushButton(QWidget* parent, const char* name = 0); + explicit PushButton(TQWidget* parent, const char* name = 0); /** Constructor for a push button which displays a text. * @param text The text to show on the button. * @param parent The parent object of this widget. * @param name The name of this widget. */ - PushButton(const QString& text, QWidget* parent, const char* name = 0); + PushButton(const TQString& text, TQWidget* parent, const char* name = 0); /** Constructor for a push button which displays an icon and a text. * @param icon The icon to show on the button. * @param text The text to show on the button. * @param parent The parent object of this widget. * @param name The name of this widget. */ - PushButton(const QIconSet& icon, const QString& text, QWidget* parent, const char* name = 0); + PushButton(const TQIconSet& icon, const TQString& text, TQWidget* parent, const char* name = 0); /** Sets whether the push button is read-only for the user. * @param readOnly True to set the widget read-only, false to enable its action. */ @@ -64,13 +64,13 @@ class PushButton : public QPushButton /** Returns true if the widget is read only. */ virtual bool isReadOnly() const { return mReadOnly; } protected: - virtual void mousePressEvent(QMouseEvent*); - virtual void mouseReleaseEvent(QMouseEvent*); - virtual void mouseMoveEvent(QMouseEvent*); - virtual void keyPressEvent(QKeyEvent*); - virtual void keyReleaseEvent(QKeyEvent*); + virtual void mousePressEvent(TQMouseEvent*); + virtual void mouseReleaseEvent(TQMouseEvent*); + virtual void mouseMoveEvent(TQMouseEvent*); + virtual void keyPressEvent(TQKeyEvent*); + virtual void keyReleaseEvent(TQKeyEvent*); private: - QWidget::FocusPolicy mFocusPolicy; // default focus policy for the QPushButton + TQWidget::FocusPolicy mFocusPolicy; // default focus policy for the QPushButton bool mReadOnly; // value cannot be changed }; diff --git a/kalarm/lib/radiobutton.cpp b/kalarm/lib/radiobutton.cpp index d66911eeb..7cf58f082 100644 --- a/kalarm/lib/radiobutton.cpp +++ b/kalarm/lib/radiobutton.cpp @@ -21,15 +21,15 @@ #include "radiobutton.moc" -RadioButton::RadioButton(QWidget* parent, const char* name) - : QRadioButton(parent, name), +RadioButton::RadioButton(TQWidget* parent, const char* name) + : TQRadioButton(parent, name), mFocusPolicy(focusPolicy()), mFocusWidget(0), mReadOnly(false) { } -RadioButton::RadioButton(const QString& text, QWidget* parent, const char* name) - : QRadioButton(text, parent, name), +RadioButton::RadioButton(const TQString& text, TQWidget* parent, const char* name) + : TQRadioButton(text, parent, name), mFocusPolicy(focusPolicy()), mFocusWidget(0), mReadOnly(false) @@ -44,7 +44,7 @@ void RadioButton::setReadOnly(bool ro) if ((int)ro != (int)mReadOnly) { mReadOnly = ro; - setFocusPolicy(ro ? QWidget::NoFocus : mFocusPolicy); + setFocusPolicy(ro ? TQWidget::NoFocus : mFocusPolicy); if (ro) clearFocus(); } @@ -53,14 +53,14 @@ void RadioButton::setReadOnly(bool ro) /****************************************************************************** * Specify a widget to receive focus when the button is clicked on. */ -void RadioButton::setFocusWidget(QWidget* w, bool enable) +void RadioButton::setFocusWidget(TQWidget* w, bool enable) { mFocusWidget = w; mFocusWidgetEnable = enable; if (w) - connect(this, SIGNAL(clicked()), SLOT(slotClicked())); + connect(this, TQT_SIGNAL(clicked()), TQT_SLOT(slotClicked())); else - disconnect(this, SIGNAL(clicked()), this, SLOT(slotClicked())); + disconnect(this, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClicked())); } /****************************************************************************** @@ -81,7 +81,7 @@ void RadioButton::slotClicked() * Event handlers to intercept events if in read-only mode. * Any events which could change the button state are discarded. */ -void RadioButton::mousePressEvent(QMouseEvent* e) +void RadioButton::mousePressEvent(TQMouseEvent* e) { if (mReadOnly) { @@ -89,10 +89,10 @@ void RadioButton::mousePressEvent(QMouseEvent* e) if (e->button() == Qt::LeftButton) return; } - QRadioButton::mousePressEvent(e); + TQRadioButton::mousePressEvent(e); } -void RadioButton::mouseReleaseEvent(QMouseEvent* e) +void RadioButton::mouseReleaseEvent(TQMouseEvent* e) { if (mReadOnly) { @@ -100,16 +100,16 @@ void RadioButton::mouseReleaseEvent(QMouseEvent* e) if (e->button() == Qt::LeftButton) return; } - QRadioButton::mouseReleaseEvent(e); + TQRadioButton::mouseReleaseEvent(e); } -void RadioButton::mouseMoveEvent(QMouseEvent* e) +void RadioButton::mouseMoveEvent(TQMouseEvent* e) { if (!mReadOnly) - QRadioButton::mouseMoveEvent(e); + TQRadioButton::mouseMoveEvent(e); } -void RadioButton::keyPressEvent(QKeyEvent* e) +void RadioButton::keyPressEvent(TQKeyEvent* e) { if (mReadOnly) switch (e->key()) @@ -124,11 +124,11 @@ void RadioButton::keyPressEvent(QKeyEvent* e) default: return; } - QRadioButton::keyPressEvent(e); + TQRadioButton::keyPressEvent(e); } -void RadioButton::keyReleaseEvent(QKeyEvent* e) +void RadioButton::keyReleaseEvent(TQKeyEvent* e) { if (!mReadOnly) - QRadioButton::keyReleaseEvent(e); + TQRadioButton::keyReleaseEvent(e); } diff --git a/kalarm/lib/radiobutton.h b/kalarm/lib/radiobutton.h index 96bca04dd..c87ef97b8 100644 --- a/kalarm/lib/radiobutton.h +++ b/kalarm/lib/radiobutton.h @@ -21,13 +21,13 @@ #ifndef RADIOBUTTON_H #define RADIOBUTTON_H -#include <qradiobutton.h> +#include <tqradiobutton.h> /** - * @short A QRadioButton with focus widget and read-only options. + * @short A TQRadioButton with focus widget and read-only options. * - * The RadioButton class is a QRadioButton with the ability to transfer focus to + * The RadioButton class is a TQRadioButton with the ability to transfer focus to * another widget when checked, and with a read-only option. * * Another widget may be specified as the focus widget for the radio button. Whenever @@ -47,13 +47,13 @@ class RadioButton : public QRadioButton * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit RadioButton(QWidget* parent, const char* name = 0); + explicit RadioButton(TQWidget* parent, const char* name = 0); /** Constructor. * @param text Text to display. * @param parent The parent object of this widget. * @param name The name of this widget. */ - RadioButton(const QString& text, QWidget* parent, const char* name = 0); + RadioButton(const TQString& text, TQWidget* parent, const char* name = 0); /** Returns true if the widget is read only. */ bool isReadOnly() const { return mReadOnly; } /** Sets whether the radio button is read-only for the user. If read-only, @@ -62,25 +62,25 @@ class RadioButton : public QRadioButton */ virtual void setReadOnly(bool readOnly); /** Returns the widget which receives focus when the button is clicked. */ - QWidget* focusWidget() const { return mFocusWidget; } + TQWidget* focusWidget() const { return mFocusWidget; } /** Specifies a widget to receive focus when the button is clicked. * @param widget Widget to receive focus. * @param enable If true, @p widget will be enabled before receiving focus. If * false, the enabled state of @p widget will be left unchanged when * the radio button is clicked. */ - void setFocusWidget(QWidget* widget, bool enable = true); + void setFocusWidget(TQWidget* widget, bool enable = true); protected: - virtual void mousePressEvent(QMouseEvent*); - virtual void mouseReleaseEvent(QMouseEvent*); - virtual void mouseMoveEvent(QMouseEvent*); - virtual void keyPressEvent(QKeyEvent*); - virtual void keyReleaseEvent(QKeyEvent*); + virtual void mousePressEvent(TQMouseEvent*); + virtual void mouseReleaseEvent(TQMouseEvent*); + virtual void mouseMoveEvent(TQMouseEvent*); + virtual void keyPressEvent(TQKeyEvent*); + virtual void keyReleaseEvent(TQKeyEvent*); protected slots: void slotClicked(); private: - QWidget::FocusPolicy mFocusPolicy; // default focus policy for the QRadioButton - QWidget* mFocusWidget; // widget to receive focus when button is clicked on + TQWidget::FocusPolicy mFocusPolicy; // default focus policy for the QRadioButton + TQWidget* mFocusWidget; // widget to receive focus when button is clicked on bool mFocusWidgetEnable; // enable focus widget before setting focus bool mReadOnly; // value cannot be changed }; diff --git a/kalarm/lib/shellprocess.cpp b/kalarm/lib/shellprocess.cpp index 1e37d2e74..209f1aad8 100644 --- a/kalarm/lib/shellprocess.cpp +++ b/kalarm/lib/shellprocess.cpp @@ -31,13 +31,13 @@ #include "shellprocess.moc" -QCString ShellProcess::mShellName; -QCString ShellProcess::mShellPath; +TQCString ShellProcess::mShellName; +TQCString ShellProcess::mShellPath; bool ShellProcess::mInitialised = false; bool ShellProcess::mAuthorised = false; -ShellProcess::ShellProcess(const QString& command) +ShellProcess::ShellProcess(const TQString& command) : KShellProcess(shellName()), mCommand(command), mStatus(INACTIVE), @@ -56,8 +56,8 @@ bool ShellProcess::start(Communication comm) return false; } KShellProcess::operator<<(mCommand); - connect(this, SIGNAL(wroteStdin(KProcess*)), SLOT(writtenStdin(KProcess*))); - connect(this, SIGNAL(processExited(KProcess*)), SLOT(slotExited(KProcess*))); + connect(this, TQT_SIGNAL(wroteStdin(KProcess*)), TQT_SLOT(writtenStdin(KProcess*))); + connect(this, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(slotExited(KProcess*))); if (!KShellProcess::start(KProcess::NotifyOnExit, comm)) { mStatus = START_FAIL; @@ -101,7 +101,7 @@ void ShellProcess::slotExited(KProcess* proc) */ void ShellProcess::writeStdin(const char* buffer, int bufflen) { - QCString scopy(buffer, bufflen+1); // construct a deep copy + TQCString scopy(buffer, bufflen+1); // construct a deep copy bool write = mStdinQueue.isEmpty(); mStdinQueue.append(scopy); if (write) @@ -138,7 +138,7 @@ void ShellProcess::stdinExit() * Return the error message corresponding to the command exit status. * Reply = null string if not yet exited, or if command successful. */ -QString ShellProcess::errorMessage() const +TQString ShellProcess::errorMessage() const { switch (mStatus) { @@ -153,7 +153,7 @@ QString ShellProcess::errorMessage() const case RUNNING: case SUCCESS: default: - return QString::null; + return TQString::null; } } @@ -162,13 +162,13 @@ QString ShellProcess::errorMessage() const * This is a duplication of what KShellProcess does, but we need to know * which shell is used in order to decide what its exit code means. */ -const QCString& ShellProcess::shellPath() +const TQCString& ShellProcess::shellPath() { if (mShellPath.isEmpty()) { // Get the path to the shell mShellPath = "/bin/sh"; - QCString envshell = QCString(getenv("SHELL")).stripWhiteSpace(); + TQCString envshell = TQCString(getenv("SHELL")).stripWhiteSpace(); if (!envshell.isEmpty()) { struct stat fileinfo; diff --git a/kalarm/lib/shellprocess.h b/kalarm/lib/shellprocess.h index 06a262a8d..a3b8a574b 100644 --- a/kalarm/lib/shellprocess.h +++ b/kalarm/lib/shellprocess.h @@ -72,7 +72,7 @@ class ShellProcess : public KShellProcess /** Constructor. * @param command The command line to be run when start() is called. */ - explicit ShellProcess(const QString& command); + explicit ShellProcess(const TQString& command); /** Executes the configured command. * @param comm Which communication links should be established to the child process * (stdin/stdout/stderr). @@ -85,12 +85,12 @@ class ShellProcess : public KShellProcess */ bool normalExit() const { return mStatus == SUCCESS; } /** Returns the command configured to be run. */ - const QString& command() const { return mCommand; } + const TQString& command() const { return mCommand; } /** Returns the error message corresponding to the command exit status. * @return Error message if an error occurred. Null string if the command has not yet * exited, or if the command ran successfully. */ - QString errorMessage() const; + TQString errorMessage() const; /** Writes a string to the process's STDIN. */ void writeStdin(const char* buffer, int bufflen); /** Tell the process to exit once any outstanding STDIN strings have been written. */ @@ -102,11 +102,11 @@ class ShellProcess : public KShellProcess /** Determines which shell to use. * @return file name of shell, excluding path. */ - static const QCString& shellName() { shellPath(); return mShellName; } + static const TQCString& shellName() { shellPath(); return mShellName; } /** Determines which shell to use. * @return path name of shell. */ - static const QCString& shellPath(); + static const TQCString& shellPath(); signals: /** Signal emitted when the shell process execution completes. It is not emitted @@ -120,17 +120,17 @@ class ShellProcess : public KShellProcess private: // Prohibit the following inherited methods - ShellProcess& operator<<(const QString&); - ShellProcess& operator<<(const QCString&); - ShellProcess& operator<<(const QStringList&); + ShellProcess& operator<<(const TQString&); + ShellProcess& operator<<(const TQCString&); + ShellProcess& operator<<(const TQStringList&); ShellProcess& operator<<(const char*); - static QCString mShellName; // name of shell to be used - static QCString mShellPath; // path of shell to be used + static TQCString mShellName; // name of shell to be used + static TQCString mShellPath; // path of shell to be used static bool mInitialised; // true once static data has been initialised static bool mAuthorised; // true if shell commands are authorised - QString mCommand; // copy of command to be executed - QValueList<QCString> mStdinQueue; // queued strings to send to STDIN + TQString mCommand; // copy of command to be executed + TQValueList<TQCString> mStdinQueue; // queued strings to send to STDIN Status mStatus; // current execution status bool mStdinExit; // exit once STDIN queue has been written }; diff --git a/kalarm/lib/slider.cpp b/kalarm/lib/slider.cpp index 1a0999645..afe7d679c 100644 --- a/kalarm/lib/slider.cpp +++ b/kalarm/lib/slider.cpp @@ -21,18 +21,18 @@ #include "slider.moc" -Slider::Slider(QWidget* parent, const char* name) - : QSlider(parent, name), +Slider::Slider(TQWidget* parent, const char* name) + : TQSlider(parent, name), mReadOnly(false) { } -Slider::Slider(Orientation o, QWidget* parent, const char* name) - : QSlider(o, parent, name), +Slider::Slider(Orientation o, TQWidget* parent, const char* name) + : TQSlider(o, parent, name), mReadOnly(false) { } -Slider::Slider(int minval, int maxval, int pageStep, int value, Orientation o, QWidget* parent, const char* name) - : QSlider(minval, maxval, pageStep, value, o, parent, name), +Slider::Slider(int minval, int maxval, int pageStep, int value, Orientation o, TQWidget* parent, const char* name) + : TQSlider(minval, maxval, pageStep, value, o, parent, name), mReadOnly(false) { } @@ -49,7 +49,7 @@ void Slider::setReadOnly(bool ro) * Event handlers to intercept events if in read-only mode. * Any events which could change the slider value are discarded. */ -void Slider::mousePressEvent(QMouseEvent* e) +void Slider::mousePressEvent(TQMouseEvent* e) { if (mReadOnly) { @@ -57,29 +57,29 @@ void Slider::mousePressEvent(QMouseEvent* e) if (e->button() == Qt::LeftButton) return; } - QSlider::mousePressEvent(e); + TQSlider::mousePressEvent(e); } -void Slider::mouseReleaseEvent(QMouseEvent* e) +void Slider::mouseReleaseEvent(TQMouseEvent* e) { if (!mReadOnly) - QSlider::mouseReleaseEvent(e); + TQSlider::mouseReleaseEvent(e); } -void Slider::mouseMoveEvent(QMouseEvent* e) +void Slider::mouseMoveEvent(TQMouseEvent* e) { if (!mReadOnly) - QSlider::mouseMoveEvent(e); + TQSlider::mouseMoveEvent(e); } -void Slider::keyPressEvent(QKeyEvent* e) +void Slider::keyPressEvent(TQKeyEvent* e) { if (!mReadOnly || e->key() == Qt::Key_Escape) - QSlider::keyPressEvent(e); + TQSlider::keyPressEvent(e); } -void Slider::keyReleaseEvent(QKeyEvent* e) +void Slider::keyReleaseEvent(TQKeyEvent* e) { if (!mReadOnly) - QSlider::keyReleaseEvent(e); + TQSlider::keyReleaseEvent(e); } diff --git a/kalarm/lib/slider.h b/kalarm/lib/slider.h index 17635e68a..8fa54d452 100644 --- a/kalarm/lib/slider.h +++ b/kalarm/lib/slider.h @@ -21,13 +21,13 @@ #ifndef SLIDER_H #define SLIDER_H -#include <qslider.h> +#include <tqslider.h> /** - * @short A QSlider with read-only option. + * @short A TQSlider with read-only option. * - * The Slider class is a QSlider with a read-only option. + * The Slider class is a TQSlider with a read-only option. * * The widget may be set as read-only. This has the same effect as disabling it, except * that its appearance is unchanged. @@ -43,13 +43,13 @@ class Slider : public QSlider * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit Slider(QWidget* parent = 0, const char* name = 0); + explicit Slider(TQWidget* parent = 0, const char* name = 0); /** Constructor. * @param orient The orientation of the slider, either Qt::Horizonal or Qt::Vertical. * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit Slider(Orientation orient, QWidget* parent = 0, const char* name = 0); + explicit Slider(Orientation orient, TQWidget* parent = 0, const char* name = 0); /** Constructor. * @param minValue The minimum value which the slider can have. * @param maxValue The maximum value which the slider can have. @@ -60,7 +60,7 @@ class Slider : public QSlider * @param name The name of this widget. */ Slider(int minValue, int maxValue, int pageStep, int value, Orientation orient, - QWidget* parent = 0, const char* name = 0); + TQWidget* parent = 0, const char* name = 0); /** Returns true if the slider is read only. */ bool isReadOnly() const { return mReadOnly; } /** Sets whether the slider is read-only for the user. @@ -68,11 +68,11 @@ class Slider : public QSlider */ virtual void setReadOnly(bool readOnly); protected: - virtual void mousePressEvent(QMouseEvent*); - virtual void mouseReleaseEvent(QMouseEvent*); - virtual void mouseMoveEvent(QMouseEvent*); - virtual void keyPressEvent(QKeyEvent*); - virtual void keyReleaseEvent(QKeyEvent*); + virtual void mousePressEvent(TQMouseEvent*); + virtual void mouseReleaseEvent(TQMouseEvent*); + virtual void mouseMoveEvent(TQMouseEvent*); + virtual void keyPressEvent(TQKeyEvent*); + virtual void keyReleaseEvent(TQKeyEvent*); private: bool mReadOnly; // value cannot be changed by the user }; diff --git a/kalarm/lib/spinbox.cpp b/kalarm/lib/spinbox.cpp index bb9ef2441..6145114a3 100644 --- a/kalarm/lib/spinbox.cpp +++ b/kalarm/lib/spinbox.cpp @@ -19,21 +19,21 @@ */ #include <kdeversion.h> -#include <qlineedit.h> -#include <qobjectlist.h> +#include <tqlineedit.h> +#include <tqobjectlist.h> #include "spinbox.moc" -SpinBox::SpinBox(QWidget* parent, const char* name) - : QSpinBox(0, 99999, 1, parent, name), - mMinValue(QSpinBox::minValue()), - mMaxValue(QSpinBox::maxValue()) +SpinBox::SpinBox(TQWidget* parent, const char* name) + : TQSpinBox(0, 99999, 1, parent, name), + mMinValue(TQSpinBox::minValue()), + mMaxValue(TQSpinBox::maxValue()) { init(); } -SpinBox::SpinBox(int minValue, int maxValue, int step, QWidget* parent, const char* name) - : QSpinBox(minValue, maxValue, step, parent, name), +SpinBox::SpinBox(int minValue, int maxValue, int step, TQWidget* parent, const char* name) + : TQSpinBox(minValue, maxValue, step, parent, name), mMinValue(minValue), mMaxValue(maxValue) { @@ -42,7 +42,7 @@ SpinBox::SpinBox(int minValue, int maxValue, int step, QWidget* parent, const ch void SpinBox::init() { - int step = QSpinBox::lineStep(); + int step = TQSpinBox::lineStep(); mLineStep = step; mLineShiftStep = step; mCurrentButton = NO_BUTTON; @@ -56,8 +56,8 @@ void SpinBox::init() // Find the spin widgets which are part of the spin boxes, in order to // handle their shift-button presses. - QObjectList* spinwidgets = queryList("QSpinWidget", 0, false, true); - QSpinWidget* spin = (QSpinWidget*)spinwidgets->getFirst(); + TQObjectList* spinwidgets = queryList("TQSpinWidget", 0, false, true); + TQSpinWidget* spin = (TQSpinWidget*)spinwidgets->getFirst(); if (spin) spin->installEventFilter(this); // handle shift-button presses delete spinwidgets; @@ -65,7 +65,7 @@ void SpinBox::init() #if KDE_IS_VERSION(3,1,90) // Detect when the text field is edited - connect(editor(), SIGNAL(textChanged(const QString&)), SLOT(textEdited())); + connect(editor(), TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(textEdited())); #endif } @@ -88,14 +88,14 @@ int SpinBox::bound(int val) const void SpinBox::setMinValue(int val) { mMinValue = val; - QSpinBox::setMinValue(val); + TQSpinBox::setMinValue(val); mShiftMinBound = false; } void SpinBox::setMaxValue(int val) { mMaxValue = val; - QSpinBox::setMaxValue(val); + TQSpinBox::setMaxValue(val); mShiftMaxBound = false; } @@ -103,26 +103,26 @@ void SpinBox::setLineStep(int step) { mLineStep = step; if (!mShiftMouse) - QSpinBox::setLineStep(step); + TQSpinBox::setLineStep(step); } void SpinBox::setLineShiftStep(int step) { mLineShiftStep = step; if (mShiftMouse) - QSpinBox::setLineStep(step); + TQSpinBox::setLineStep(step); } void SpinBox::stepUp() { - int step = QSpinBox::lineStep(); + int step = TQSpinBox::lineStep(); addValue(step); emit stepped(step); } void SpinBox::stepDown() { - int step = -QSpinBox::lineStep(); + int step = -TQSpinBox::lineStep(); addValue(step); emit stepped(step); } @@ -135,8 +135,8 @@ void SpinBox::stepDown() void SpinBox::addValue(int change, bool current) { int newval = value() + change; - int maxval = current ? QSpinBox::maxValue() : mMaxValue; - int minval = current ? QSpinBox::minValue() : mMinValue; + int maxval = current ? TQSpinBox::maxValue() : mMaxValue; + int minval = current ? TQSpinBox::minValue() : mMinValue; if (wrapping()) { int range = maxval - minval + 1; @@ -163,20 +163,20 @@ void SpinBox::valueChange() if (mShiftMinBound && val >= mMinValue) { // Reinstate the minimum bound now that the value has returned to the normal range. - QSpinBox::setMinValue(mMinValue); + TQSpinBox::setMinValue(mMinValue); mShiftMinBound = false; } if (mShiftMaxBound && val <= mMaxValue) { // Reinstate the maximum bound now that the value has returned to the normal range. - QSpinBox::setMaxValue(mMaxValue); + TQSpinBox::setMaxValue(mMaxValue); mShiftMaxBound = false; } bool focus = !mSelectOnStep && hasFocus(); if (focus) clearFocus(); // prevent selection of the spin box text - QSpinBox::valueChange(); + TQSpinBox::valueChange(); if (focus) setFocus(); } @@ -193,13 +193,13 @@ void SpinBox::textEdited() void SpinBox::updateDisplay() { mEdited = false; - QSpinBox::updateDisplay(); + TQSpinBox::updateDisplay(); } /****************************************************************************** * Receives events destined for the spin widget or for the edit field. */ -bool SpinBox::eventFilter(QObject* obj, QEvent* e) +bool SpinBox::eventFilter(TQObject* obj, TQEvent* e) { if (obj == editor()) { @@ -207,10 +207,10 @@ bool SpinBox::eventFilter(QObject* obj, QEvent* e) bool shift = false; switch (e->type()) { - case QEvent::KeyPress: + case TQEvent::KeyPress: { // Up and down arrow keys step the value - QKeyEvent* ke = (QKeyEvent*)e; + TQKeyEvent* ke = (TQKeyEvent*)e; int key = ke->key(); if (key == Qt::Key_Up) step = 1; @@ -219,15 +219,15 @@ bool SpinBox::eventFilter(QObject* obj, QEvent* e) shift = ((ke->state() & (Qt::ShiftButton | Qt::AltButton)) == Qt::ShiftButton); break; } - case QEvent::Wheel: + case TQEvent::Wheel: { - QWheelEvent* we = (QWheelEvent*)e; + TQWheelEvent* we = (TQWheelEvent*)e; step = (we->delta() > 0) ? 1 : -1; shift = ((we->state() & (Qt::ShiftButton | Qt::AltButton)) == Qt::ShiftButton); break; } #if KDE_IS_VERSION(3,1,90) - case QEvent::Leave: + case TQEvent::Leave: if (mEdited) interpretText(); break; @@ -259,10 +259,10 @@ bool SpinBox::eventFilter(QObject* obj, QEvent* e) int etype = e->type(); // avoid switch compile warnings switch (etype) { - case QEvent::MouseButtonPress: - case QEvent::MouseButtonDblClick: + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonDblClick: { - QMouseEvent* me = (QMouseEvent*)e; + TQMouseEvent* me = (TQMouseEvent*)e; if (me->button() == Qt::LeftButton) { // It's a left button press. Set normal or shift stepping as appropriate. @@ -278,9 +278,9 @@ bool SpinBox::eventFilter(QObject* obj, QEvent* e) } break; } - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: { - QMouseEvent* me = (QMouseEvent*)e; + TQMouseEvent* me = (TQMouseEvent*)e; if (me->button() == Qt::LeftButton && mShiftMouse) { setShiftStepping(false, mCurrentButton); // cancel shift stepping @@ -288,9 +288,9 @@ bool SpinBox::eventFilter(QObject* obj, QEvent* e) } break; } - case QEvent::MouseMove: + case TQEvent::MouseMove: { - QMouseEvent* me = (QMouseEvent*)e; + TQMouseEvent* me = (TQMouseEvent*)e; if (me->state() & Qt::LeftButton) { // The left button is down. Track which spin button it's in. @@ -310,19 +310,19 @@ bool SpinBox::eventFilter(QObject* obj, QEvent* e) } break; } - case QEvent::Wheel: + case TQEvent::Wheel: { - QWheelEvent* we = (QWheelEvent*)e; + TQWheelEvent* we = (TQWheelEvent*)e; bool shift = (we->state() & (Qt::ShiftButton | Qt::AltButton)) == Qt::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 } - case QEvent::KeyPress: - case QEvent::KeyRelease: - case QEvent::AccelOverride: // this is needed to receive Shift presses! + case TQEvent::KeyPress: + case TQEvent::KeyRelease: + case TQEvent::AccelOverride: // this is needed to receive Shift presses! { - QKeyEvent* ke = (QKeyEvent*)e; + TQKeyEvent* ke = (TQKeyEvent*)e; int key = ke->key(); int state = ke->state(); if ((state & Qt::LeftButton) @@ -345,7 +345,7 @@ bool SpinBox::eventFilter(QObject* obj, QEvent* e) } } } - return QSpinBox::eventFilter(obj, e); + return TQSpinBox::eventFilter(obj, e); } /****************************************************************************** @@ -389,7 +389,7 @@ bool SpinBox::setShiftStepping(bool shift, int currentButton) newval = mMinValue; else newval = (newval <= minval) ? minval : mMaxValue; - QSpinBox::setValue(newval); + TQSpinBox::setValue(newval); emit stepped(step); return true; } @@ -399,12 +399,12 @@ bool SpinBox::setShiftStepping(bool shift, int currentButton) int tempval = val + adjust; if (tempval < mMinValue) { - QSpinBox::setMinValue(tempval); + TQSpinBox::setMinValue(tempval); mShiftMinBound = true; } else if (tempval > mMaxValue) { - QSpinBox::setMaxValue(tempval); + TQSpinBox::setMaxValue(tempval); mShiftMaxBound = true; } } @@ -417,14 +417,14 @@ bool SpinBox::setShiftStepping(bool shift, int currentButton) blockSignals(blocked); mSuppressSignals = false; } - QSpinBox::setLineStep(mLineShiftStep); + TQSpinBox::setLineStep(mLineShiftStep); } else if (!shift && mShiftMouse) { // Reinstate to normal (non-shift) stepping - QSpinBox::setLineStep(mLineStep); - QSpinBox::setMinValue(mMinValue); - QSpinBox::setMaxValue(mMaxValue); + TQSpinBox::setLineStep(mLineStep); + TQSpinBox::setMinValue(mMinValue); + TQSpinBox::setMaxValue(mMaxValue); mShiftMinBound = mShiftMaxBound = false; mShiftMouse = false; } @@ -466,7 +466,7 @@ int SpinBox::shiftStepAdjustment(int oldValue, int shiftStep) /****************************************************************************** * Find which spin widget button a mouse event is in. */ -int SpinBox::whichButton(const QPoint& pos) +int SpinBox::whichButton(const TQPoint& pos) { if (upRect().contains(pos)) return UP; diff --git a/kalarm/lib/spinbox.h b/kalarm/lib/spinbox.h index 0df910233..cf74e9deb 100644 --- a/kalarm/lib/spinbox.h +++ b/kalarm/lib/spinbox.h @@ -21,13 +21,13 @@ #ifndef SPINBOX_H #define SPINBOX_H -#include <qspinbox.h> +#include <tqspinbox.h> /** * @short Spin box with accelerated shift key stepping and read-only option. * - * The SpinBox class provides a QSpinBox with accelerated stepping using the shift key. + * The SpinBox class provides a TQSpinBox with accelerated stepping using the shift key. * * A separate step increment may optionally be specified for use when the shift key is * held down. Typically this would be larger than the normal step. Then, when the user @@ -47,7 +47,7 @@ class SpinBox : public QSpinBox * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit SpinBox(QWidget* parent = 0, const char* name = 0); + explicit SpinBox(TQWidget* parent = 0, const char* name = 0); /** Constructor. * @param minValue The minimum value which the spin box can have. * @param maxValue The maximum value which the spin box can have. @@ -55,7 +55,7 @@ class SpinBox : public QSpinBox * @param parent The parent object of this widget. * @param name The name of this widget. */ - SpinBox(int minValue, int maxValue, int step = 1, QWidget* parent = 0, const char* name = 0); + SpinBox(int minValue, int maxValue, int step = 1, TQWidget* parent = 0, const char* name = 0); /** Returns true if the widget is read only. */ bool isReadOnly() const { return mReadOnly; } /** Sets whether the spin box can be changed by the user. @@ -123,8 +123,8 @@ class SpinBox : public QSpinBox */ virtual int shiftStepAdjustment(int oldValue, int shiftStep); /** Receives events destined for the spin widget or for the edit field. */ - virtual bool eventFilter(QObject*, QEvent*); - /** Updates the contents of the embedded QLineEdit to reflect the current value + virtual bool eventFilter(TQObject*, TQEvent*); + /** Updates the contents of the embedded TQLineEdit to reflect the current value * using mapValueToText(). Also enables/disables the up/down push buttons accordingly. */ virtual void updateDisplay(); @@ -134,7 +134,7 @@ class SpinBox : public QSpinBox private: void init(); void addValue(int change, bool current); - int whichButton(const QPoint&); + int whichButton(const TQPoint&); bool setShiftStepping(bool, int currentButton); enum { NO_BUTTON, UP, DOWN }; diff --git a/kalarm/lib/spinbox2.cpp b/kalarm/lib/spinbox2.cpp index 313d3eb56..48b88d51c 100644 --- a/kalarm/lib/spinbox2.cpp +++ b/kalarm/lib/spinbox2.cpp @@ -18,17 +18,17 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qglobal.h> +#include <tqglobal.h> #include <stdlib.h> -#include <qstyle.h> -#include <qobjectlist.h> -#include <qapplication.h> -#include <qpixmap.h> -#include <qcursor.h> -#include <qtimer.h> -#include <qwmatrix.h> +#include <tqstyle.h> +#include <tqobjectlist.h> +#include <tqapplication.h> +#include <tqpixmap.h> +#include <tqcursor.h> +#include <tqtimer.h> +#include <tqwmatrix.h> #include "spinbox2.moc" #include "spinbox2private.moc" @@ -43,29 +43,29 @@ static const char* mirrorStyles[] = { "PlastikStyle", 0 // list terminator }; -static bool mirrorStyle(const QStyle&); +static bool mirrorStyle(const TQStyle&); int SpinBox2::mReverseLayout = -1; -SpinBox2::SpinBox2(QWidget* parent, const char* name) - : QFrame(parent, name), +SpinBox2::SpinBox2(TQWidget* parent, const char* name) + : TQFrame(parent, name), mReverseWithLayout(true) { - mUpdown2Frame = new QFrame(this); - mSpinboxFrame = new QFrame(this); + mUpdown2Frame = new TQFrame(this); + mSpinboxFrame = new TQFrame(this); mUpdown2 = new ExtraSpinBox(mUpdown2Frame, "updown2"); // mSpinbox = new MainSpinBox(0, 1, 1, this, mSpinboxFrame); mSpinbox = new MainSpinBox(this, mSpinboxFrame); init(); } -SpinBox2::SpinBox2(int minValue, int maxValue, int step, int step2, QWidget* parent, const char* name) - : QFrame(parent, name), +SpinBox2::SpinBox2(int minValue, int maxValue, int step, int step2, TQWidget* parent, const char* name) + : TQFrame(parent, name), mReverseWithLayout(true) { - mUpdown2Frame = new QFrame(this); - mSpinboxFrame = new QFrame(this); + mUpdown2Frame = new TQFrame(this); + mSpinboxFrame = new TQFrame(this); mUpdown2 = new ExtraSpinBox(minValue, maxValue, step2, mUpdown2Frame, "updown2"); mSpinbox = new MainSpinBox(minValue, maxValue, step, this, mSpinboxFrame); setSteps(step, step2); @@ -75,7 +75,7 @@ SpinBox2::SpinBox2(int minValue, int maxValue, int step, int step2, QWidget* par void SpinBox2::init() { if (mReverseLayout < 0) - mReverseLayout = QApplication::reverseLayout() ? 1 : 0; + mReverseLayout = TQApplication::reverseLayout() ? 1 : 0; mMinValue = mSpinbox->minValue(); mMaxValue = mSpinbox->maxValue(); mLineStep = mSpinbox->lineStep(); @@ -85,15 +85,15 @@ void SpinBox2::init() mSpinbox->setSelectOnStep(false); // default mUpdown2->setSelectOnStep(false); // always false setFocusProxy(mSpinbox); - mUpdown2->setFocusPolicy(QWidget::NoFocus); + mUpdown2->setFocusPolicy(TQWidget::NoFocus); mSpinMirror = new SpinMirror(mUpdown2, mUpdown2Frame, this); if (!mirrorStyle(style())) mSpinMirror->hide(); // hide mirrored spin buttons when they are inappropriate - connect(mSpinbox, SIGNAL(valueChanged(int)), SLOT(valueChange())); - connect(mSpinbox, SIGNAL(valueChanged(int)), SIGNAL(valueChanged(int))); - connect(mSpinbox, SIGNAL(valueChanged(const QString&)), SIGNAL(valueChanged(const QString&))); - connect(mUpdown2, SIGNAL(stepped(int)), SLOT(stepPage(int))); - connect(mUpdown2, SIGNAL(styleUpdated()), SLOT(updateMirror())); + connect(mSpinbox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(valueChange())); + connect(mSpinbox, TQT_SIGNAL(valueChanged(int)), TQT_SIGNAL(valueChanged(int))); + connect(mSpinbox, TQT_SIGNAL(valueChanged(const TQString&)), TQT_SIGNAL(valueChanged(const TQString&))); + connect(mUpdown2, TQT_SIGNAL(stepped(int)), TQT_SLOT(stepPage(int))); + connect(mUpdown2, TQT_SIGNAL(styleUpdated()), TQT_SLOT(updateMirror())); } void SpinBox2::setReadOnly(bool ro) @@ -118,7 +118,7 @@ void SpinBox2::setReverseWithLayout(bool reverse) void SpinBox2::setEnabled(bool enabled) { - QFrame::setEnabled(enabled); + TQFrame::setEnabled(enabled); updateMirror(); } @@ -128,12 +128,12 @@ void SpinBox2::setWrapping(bool on) mUpdown2->setWrapping(on); } -QRect SpinBox2::up2Rect() const +TQRect SpinBox2::up2Rect() const { return mUpdown2->upRect(); } -QRect SpinBox2::down2Rect() const +TQRect SpinBox2::down2Rect() const { return mUpdown2->downRect(); } @@ -179,7 +179,7 @@ void SpinBox2::setShiftSteps(int line, int page) } } -void SpinBox2::setButtonSymbols(QSpinBox::ButtonSymbols newSymbols) +void SpinBox2::setButtonSymbols(TQSpinBox::ButtonSymbols newSymbols) { if (mSpinbox->buttonSymbols() == newSymbols) return; @@ -220,28 +220,28 @@ void SpinBox2::valueChange() * (At construction time, the spin button widths cannot be determined correctly, * so we need to wait until now to definitively rearrange the widget.) */ -void SpinBox2::showEvent(QShowEvent*) +void SpinBox2::showEvent(TQShowEvent*) { arrange(); } -QSize SpinBox2::sizeHint() const +TQSize SpinBox2::sizeHint() const { getMetrics(); - QSize size = mSpinbox->sizeHint(); + TQSize size = mSpinbox->sizeHint(); size.setWidth(size.width() - xSpinbox + wUpdown2 + wGap); return size; } -QSize SpinBox2::minimumSizeHint() const +TQSize SpinBox2::minimumSizeHint() const { getMetrics(); - QSize size = mSpinbox->minimumSizeHint(); + TQSize size = mSpinbox->minimumSizeHint(); size.setWidth(size.width() - xSpinbox + wUpdown2 + wGap); return size; } -void SpinBox2::styleChange(QStyle&) +void SpinBox2::styleChange(TQStyle&) { if (mirrorStyle(style())) mSpinMirror->show(); // show rounded corners with Plastik etc. @@ -256,7 +256,7 @@ void SpinBox2::styleChange(QStyle&) */ void SpinBox2::updateMirror() { - mSpinMirror->setNormalButtons(QPixmap::grabWidget(mUpdown2Frame, 0, 0)); + mSpinMirror->setNormalButtons(TQPixmap::grabWidget(mUpdown2Frame, 0, 0)); } /****************************************************************************** @@ -265,15 +265,15 @@ void SpinBox2::updateMirror() void SpinBox2::arrange() { getMetrics(); - QRect arrowRect = QStyle::visualRect(QRect(0, 0, wUpdown2, height()), this); + TQRect arrowRect = TQStyle::visualRect(TQRect(0, 0, wUpdown2, height()), this); mUpdown2Frame->setGeometry(arrowRect); mUpdown2->setGeometry(-xUpdown2, 0, mUpdown2->width(), height()); - mSpinboxFrame->setGeometry(QStyle::visualRect(QRect(wUpdown2 + wGap, 0, width() - wUpdown2 - wGap, height()), this)); + mSpinboxFrame->setGeometry(TQStyle::visualRect(TQRect(wUpdown2 + wGap, 0, width() - wUpdown2 - wGap, height()), this)); mSpinbox->setGeometry(-xSpinbox, 0, mSpinboxFrame->width() + xSpinbox, height()); mSpinMirror->resize(wUpdown2, mUpdown2->height()); mSpinMirror->setGeometry(arrowRect); -//mSpinMirror->setGeometry(QStyle::visualRect(QRect(0, 11, wUpdown2, height()), this)); - mSpinMirror->setNormalButtons(QPixmap::grabWidget(mUpdown2Frame, 0, 0)); +//mSpinMirror->setGeometry(TQStyle::visualRect(TQRect(0, 11, wUpdown2, height()), this)); + mSpinMirror->setNormalButtons(TQPixmap::grabWidget(mUpdown2Frame, 0, 0)); } /****************************************************************************** @@ -282,16 +282,16 @@ void SpinBox2::arrange() */ void SpinBox2::getMetrics() const { - QRect rect = mUpdown2->style().querySubControlMetrics(QStyle::CC_SpinWidget, mUpdown2, QStyle::SC_SpinWidgetButtonField); + TQRect rect = mUpdown2->style().querySubControlMetrics(TQStyle::CC_SpinWidget, mUpdown2, TQStyle::SC_SpinWidgetButtonField); if (style().inherits("PlastikStyle")) rect.setLeft(rect.left() - 1); // Plastik excludes left border from spin widget rectangle xUpdown2 = mReverseLayout ? 0 : rect.left(); wUpdown2 = mUpdown2->width() - rect.left(); - xSpinbox = mSpinbox->style().querySubControlMetrics(QStyle::CC_SpinWidget, mSpinbox, QStyle::SC_SpinWidgetEditField).left(); + xSpinbox = mSpinbox->style().querySubControlMetrics(TQStyle::CC_SpinWidget, mSpinbox, TQStyle::SC_SpinWidgetEditField).left(); wGap = 0; // Make style-specific adjustments for a better appearance - if (style().inherits("QMotifPlusStyle")) + if (style().inherits("TQMotifPlusStyle")) { xSpinbox = 0; // show the edit control left border wGap = 2; // leave a space to the right of the left-hand pair of spin buttons @@ -334,7 +334,7 @@ void SpinBox2::stepPage(int step) mSpinbox->selectAll(); // Make the covering arrows image show the pressed arrow - mSpinMirror->redraw(QPixmap::grabWidget(mUpdown2Frame, 0, 0)); + mSpinMirror->redraw(TQPixmap::grabWidget(mUpdown2Frame, 0, 0)); } @@ -376,7 +376,7 @@ int SpinBox2::MainSpinBox::shiftStepAdjustment(int oldValue, int shiftStep) * presumably reasonable assumption that when a style change occurs, the spin * buttons are unpressed. */ -void ExtraSpinBox::paintEvent(QPaintEvent* e) +void ExtraSpinBox::paintEvent(TQPaintEvent* e) { SpinBox::paintEvent(e); if (mNewStylePending) @@ -391,24 +391,24 @@ void ExtraSpinBox::paintEvent(QPaintEvent* e) = Class SpinMirror =============================================================================*/ -SpinMirror::SpinMirror(SpinBox* spinbox, QFrame* spinFrame, QWidget* parent, const char* name) - : QCanvasView(new QCanvas, parent, name), +SpinMirror::SpinMirror(SpinBox* spinbox, TQFrame* spinFrame, TQWidget* parent, const char* name) + : TQCanvasView(new TQCanvas, parent, name), mSpinbox(spinbox), mSpinFrame(spinFrame), mReadOnly(false) { - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); - setFrameStyle(QFrame::NoFrame); + setVScrollBarMode(TQScrollView::AlwaysOff); + setHScrollBarMode(TQScrollView::AlwaysOff); + setFrameStyle(TQFrame::NoFrame); // Find the spin widget which is part of the spin box, in order to // pass on its shift-button presses. - QObjectList* spinwidgets = spinbox->queryList("QSpinWidget", 0, false, true); + TQObjectList* spinwidgets = spinbox->queryList("TQSpinWidget", 0, false, true); mSpinWidget = (SpinBox*)spinwidgets->getFirst(); delete spinwidgets; } -void SpinMirror::setNormalButtons(const QPixmap& px) +void SpinMirror::setNormalButtons(const TQPixmap& px) { mNormalButtons = px; redraw(mNormalButtons); @@ -416,12 +416,12 @@ void SpinMirror::setNormalButtons(const QPixmap& px) void SpinMirror::redraw() { - redraw(QPixmap::grabWidget(mSpinFrame, 0, 0)); + redraw(TQPixmap::grabWidget(mSpinFrame, 0, 0)); } -void SpinMirror::redraw(const QPixmap& px) +void SpinMirror::redraw(const TQPixmap& px) { - QCanvas* c = canvas(); + TQCanvas* c = canvas(); c->setBackgroundPixmap(px); c->setAllChanged(); c->update(); @@ -430,28 +430,28 @@ void SpinMirror::redraw(const QPixmap& px) void SpinMirror::resize(int w, int h) { canvas()->resize(w, h); - QCanvasView::resize(w, h); + TQCanvasView::resize(w, h); resizeContents(w, h); - setWorldMatrix(QWMatrix(-1, 0, 0, 1, w - 1, 0)); // mirror left to right + setWorldMatrix(TQWMatrix(-1, 0, 0, 1, w - 1, 0)); // mirror left to right } /****************************************************************************** * Pass on all mouse events to the spinbox which we're covering up. */ -void SpinMirror::contentsMouseEvent(QMouseEvent* e) +void SpinMirror::contentsMouseEvent(TQMouseEvent* e) { if (mReadOnly) return; - QPoint pt = contentsToViewport(e->pos()); + TQPoint pt = contentsToViewport(e->pos()); pt.setX(pt.x() + mSpinbox->upRect().left()); - QApplication::postEvent(mSpinWidget, new QMouseEvent(e->type(), pt, e->button(), e->state())); + TQApplication::postEvent(mSpinWidget, new TQMouseEvent(e->type(), pt, e->button(), e->state())); // If the mouse button has been pressed or released, refresh the spin buttons switch (e->type()) { - case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: - QTimer::singleShot(0, this, SLOT(redraw())); + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonRelease: + TQTimer::singleShot(0, this, TQT_SLOT(redraw())); break; default: break; @@ -461,36 +461,36 @@ void SpinMirror::contentsMouseEvent(QMouseEvent* e) /****************************************************************************** * Pass on all mouse events to the spinbox which we're covering up. */ -void SpinMirror::contentsWheelEvent(QWheelEvent* e) +void SpinMirror::contentsWheelEvent(TQWheelEvent* e) { if (mReadOnly) return; - QPoint pt = contentsToViewport(e->pos()); + TQPoint pt = contentsToViewport(e->pos()); pt.setX(pt.x() + mSpinbox->upRect().left()); - QApplication::postEvent(mSpinWidget, new QWheelEvent(pt, e->delta(), e->state(), e->orientation())); + TQApplication::postEvent(mSpinWidget, new TQWheelEvent(pt, e->delta(), e->state(), e->orientation())); } /****************************************************************************** * Pass on to the main spinbox events which are needed to activate mouseover and * other graphic effects when the mouse cursor enters and leaves the widget. */ -bool SpinMirror::event(QEvent* e) +bool SpinMirror::event(TQEvent* e) { switch (e->type()) { - case QEvent::Leave: - case QEvent::Enter: - QApplication::postEvent(mSpinWidget, new QEvent(e->type())); - QTimer::singleShot(0, this, SLOT(redraw())); + case TQEvent::Leave: + case TQEvent::Enter: + TQApplication::postEvent(mSpinWidget, new TQEvent(e->type())); + TQTimer::singleShot(0, this, TQT_SLOT(redraw())); break; - case QEvent::FocusIn: + case TQEvent::FocusIn: mSpinbox->setFocus(); - QTimer::singleShot(0, this, SLOT(redraw())); + TQTimer::singleShot(0, this, TQT_SLOT(redraw())); break; default: break; } - return QCanvasView::event(e); + return TQCanvasView::event(e); } @@ -502,7 +502,7 @@ bool SpinMirror::event(QEvent* e) * Determine whether the extra pair of spin buttons needs to be mirrored * left-to-right in the specified style. */ -static bool mirrorStyle(const QStyle& style) +static bool mirrorStyle(const TQStyle& style) { for (const char** s = mirrorStyles; *s; ++s) if (style.inherits(*s)) diff --git a/kalarm/lib/spinbox2.h b/kalarm/lib/spinbox2.h index 772eaee70..06a48d1af 100644 --- a/kalarm/lib/spinbox2.h +++ b/kalarm/lib/spinbox2.h @@ -21,8 +21,8 @@ #ifndef SPINBOX2_H #define SPINBOX2_H -#include <qglobal.h> -#include <qlineedit.h> +#include <tqglobal.h> +#include <tqlineedit.h> class SpinMirror; class ExtraSpinBox; @@ -61,7 +61,7 @@ class SpinBox2 : public QFrame * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit SpinBox2(QWidget* parent = 0, const char* name = 0); + explicit SpinBox2(TQWidget* parent = 0, const char* name = 0); /** Constructor. * @param minValue The minimum value which the spin box can have. * @param maxValue The maximum value which the spin box can have. @@ -71,7 +71,7 @@ class SpinBox2 : public QFrame * @param name The name of this widget. */ SpinBox2(int minValue, int maxValue, int step = 1, int step2 = 1, - QWidget* parent = 0, const char* name = 0); + TQWidget* parent = 0, const char* name = 0); /** Sets whether the spin box can be changed by the user. * @param readOnly True to set the widget read-only, false to set it read-write. */ @@ -88,22 +88,22 @@ class SpinBox2 : public QFrame bool reverseButtons() const { return mReverseLayout && !mReverseWithLayout; } /** Returns the spin box's text, including any prefix() and suffix(). */ - QString text() const { return mSpinbox->text(); } + TQString text() const { return mSpinbox->text(); } /** Returns the prefix for the spin box's text. */ - virtual QString prefix() const { return mSpinbox->prefix(); } + virtual TQString prefix() const { return mSpinbox->prefix(); } /** Returns the suffix for the spin box's text. */ - virtual QString suffix() const { return mSpinbox->suffix(); } + virtual TQString suffix() const { return mSpinbox->suffix(); } /** Returns the spin box's text with no prefix(), suffix() or leading or trailing whitespace. */ - virtual QString cleanText() const { return mSpinbox->cleanText(); } + virtual TQString cleanText() const { return mSpinbox->cleanText(); } /** Sets the special-value text which, if non-null, is displayed instead of a numeric * value when the current value is equal to minValue(). */ - virtual void setSpecialValueText(const QString& text) { mSpinbox->setSpecialValueText(text); } + virtual void setSpecialValueText(const TQString& text) { mSpinbox->setSpecialValueText(text); } /** Returns the special-value text which, if non-null, is displayed instead of a numeric * value when the current value is equal to minValue(). */ - QString specialValueText() const { return mSpinbox->specialValueText(); } + TQString specialValueText() const { return mSpinbox->specialValueText(); } /** Sets whether it is possible to step the value from the highest value to the * lowest value and vice versa. @@ -117,21 +117,21 @@ class SpinBox2 : public QFrame /** Set the text alignment of the widget */ void setAlignment(int a) { mSpinbox->setAlignment(a); } /** Sets the button symbols to use (arrows or plus/minus). */ - virtual void setButtonSymbols(QSpinBox::ButtonSymbols); + virtual void setButtonSymbols(TQSpinBox::ButtonSymbols); /** Returns the button symbols currently in use (arrows or plus/minus). */ - QSpinBox::ButtonSymbols buttonSymbols() const { return mSpinbox->buttonSymbols(); } + TQSpinBox::ButtonSymbols buttonSymbols() const { return mSpinbox->buttonSymbols(); } /** Sets the validator to @p v. The validator controls what keyboard input is accepted * when the user is editing the value field. */ - virtual void setValidator(const QValidator* v) { mSpinbox->setValidator(v); } + virtual void setValidator(const TQValidator* v) { mSpinbox->setValidator(v); } /** Returns the current validator. The validator controls what keyboard input is accepted * when the user is editing the value field. */ - const QValidator* validator() const { return mSpinbox->validator(); } + const TQValidator* validator() const { return mSpinbox->validator(); } - virtual QSize sizeHint() const; - virtual QSize minimumSizeHint() const; + virtual TQSize sizeHint() const; + virtual TQSize minimumSizeHint() const; /** Returns the minimum value of the spin box. */ int minValue() const { return mMinValue; } @@ -149,13 +149,13 @@ class SpinBox2 : public QFrame int bound(int val) const; /** Returns the geometry of the right-hand "up" button. */ - QRect upRect() const { return mSpinbox->upRect(); } + TQRect upRect() const { return mSpinbox->upRect(); } /** Returns the geometry of the right-hand "down" button. */ - QRect downRect() const { return mSpinbox->downRect(); } + TQRect downRect() const { return mSpinbox->downRect(); } /** Returns the geometry of the left-hand "up" button. */ - QRect up2Rect() const; + TQRect up2Rect() const; /** Returns the geometry of the left-hand "down" button. */ - QRect down2Rect() const; + TQRect down2Rect() const; /** Returns the unshifted step increment for the right-hand spin buttons, * i.e. the amount by which the spin box value changes when a right-hand @@ -220,9 +220,9 @@ class SpinBox2 : public QFrame /** Sets the current value to @p val. */ virtual void setValue(int val) { mSpinbox->setValue(val); } /** Sets the prefix which is prepended to the start of the displayed text. */ - virtual void setPrefix(const QString& text) { mSpinbox->setPrefix(text); } + virtual void setPrefix(const TQString& text) { mSpinbox->setPrefix(text); } /** Sets the suffix which is prepended to the start of the displayed text. */ - virtual void setSuffix(const QString& text) { mSpinbox->setSuffix(text); } + virtual void setSuffix(const TQString& text) { mSpinbox->setSuffix(text); } /** Increments the current value by adding the unshifted step increment for * the right-hand spin buttons. */ @@ -248,14 +248,14 @@ class SpinBox2 : public QFrame /** Signal which is emitted whenever the value of the spin box changes. */ void valueChanged(int value); /** Signal which is emitted whenever the value of the spin box changes. */ - void valueChanged(const QString& valueText); + void valueChanged(const TQString& valueText); protected: - virtual QString mapValueToText(int v) { return mSpinbox->mapValToText(v); } + virtual TQString mapValueToText(int v) { return mSpinbox->mapValToText(v); } virtual int mapTextToValue(bool* ok) { return mSpinbox->mapTextToVal(ok); } - virtual void resizeEvent(QResizeEvent*) { arrange(); } - virtual void showEvent(QShowEvent*); - virtual void styleChange(QStyle&); + virtual void resizeEvent(TQResizeEvent*) { arrange(); } + virtual void showEvent(TQShowEvent*); + virtual void styleChange(TQStyle&); virtual void getMetrics() const; mutable int wUpdown2; // width of second spin widget @@ -273,7 +273,7 @@ class SpinBox2 : public QFrame private: void init(); void arrange(); - int whichButton(QObject* spinWidget, const QPoint&); + int whichButton(TQObject* spinWidget, const TQPoint&); void setShiftStepping(bool on); // Visible spin box class. @@ -281,14 +281,14 @@ class SpinBox2 : public QFrame class MainSpinBox : public SpinBox { public: - MainSpinBox(SpinBox2* sb2, QWidget* parent, const char* name = 0) + MainSpinBox(SpinBox2* sb2, TQWidget* parent, const char* name = 0) : SpinBox(parent, name), owner(sb2) { } - MainSpinBox(int minValue, int maxValue, int step, SpinBox2* sb2, QWidget* parent, const char* name = 0) + MainSpinBox(int minValue, int maxValue, int step, SpinBox2* sb2, TQWidget* parent, const char* name = 0) : SpinBox(minValue, maxValue, step, parent, name), owner(sb2) { } void setAlignment(int a) { editor()->setAlignment(a); } - virtual QString mapValueToText(int v) { return owner->mapValueToText(v); } + virtual TQString mapValueToText(int v) { return owner->mapValueToText(v); } virtual int mapTextToValue(bool* ok) { return owner->mapTextToValue(ok); } - QString mapValToText(int v) { return SpinBox::mapValueToText(v); } + TQString mapValToText(int v) { return SpinBox::mapValueToText(v); } int mapTextToVal(bool* ok) { return SpinBox::mapTextToValue(ok); } virtual int shiftStepAdjustment(int oldValue, int shiftStep); private: @@ -298,8 +298,8 @@ class SpinBox2 : public QFrame enum { NO_BUTTON = -1, UP, DOWN, UP2, DOWN2 }; static int mReverseLayout; // widgets are mirrored right to left - QFrame* mUpdown2Frame; // contains visible part of the extra pair of spin buttons - QFrame* mSpinboxFrame; // contains the main spin box + TQFrame* mUpdown2Frame; // contains visible part of the extra pair of spin buttons + TQFrame* mSpinboxFrame; // contains the main spin box ExtraSpinBox* mUpdown2; // the extra pair of spin buttons MainSpinBox* mSpinbox; // the visible spin box SpinMirror* mSpinMirror; // image of the extra pair of spin buttons diff --git a/kalarm/lib/spinbox2private.h b/kalarm/lib/spinbox2private.h index 74fbeb66c..682c84b8d 100644 --- a/kalarm/lib/spinbox2private.h +++ b/kalarm/lib/spinbox2private.h @@ -21,7 +21,7 @@ #ifndef SPINBOX2PRIVATE_H #define SPINBOX2PRIVATE_H -#include <qcanvas.h> +#include <tqcanvas.h> #include "spinbox.h" @@ -35,15 +35,15 @@ class ExtraSpinBox : public SpinBox { Q_OBJECT public: - explicit ExtraSpinBox(QWidget* parent, const char* name = 0) + explicit ExtraSpinBox(TQWidget* parent, const char* name = 0) : SpinBox(parent, name), mNewStylePending(false) { } - ExtraSpinBox(int minValue, int maxValue, int step, QWidget* parent, const char* name = 0) + ExtraSpinBox(int minValue, int maxValue, int step, TQWidget* parent, const char* name = 0) : SpinBox(minValue, maxValue, step, parent, name), mNewStylePending(false) { } signals: void styleUpdated(); protected: - virtual void paintEvent(QPaintEvent*); - virtual void styleChange(QStyle&) { mNewStylePending = true; } + virtual void paintEvent(TQPaintEvent*); + virtual void styleChange(TQStyle&) { mNewStylePending = true; } private: bool mNewStylePending; // style has changed, but not yet repainted }; @@ -61,31 +61,31 @@ class SpinMirror : public QCanvasView { Q_OBJECT public: - explicit SpinMirror(SpinBox*, QFrame* spinFrame, QWidget* parent = 0, const char* name = 0); + explicit SpinMirror(SpinBox*, TQFrame* spinFrame, TQWidget* parent = 0, const char* name = 0); void setReadOnly(bool ro) { mReadOnly = ro; } bool isReadOnly() const { return mReadOnly; } - void setNormalButtons(const QPixmap&); - void redraw(const QPixmap&); + void setNormalButtons(const TQPixmap&); + void redraw(const TQPixmap&); public slots: virtual void resize(int w, int h); void redraw(); protected: - virtual void contentsMousePressEvent(QMouseEvent* e) { contentsMouseEvent(e); } - virtual void contentsMouseReleaseEvent(QMouseEvent* e) { contentsMouseEvent(e); } - virtual void contentsMouseMoveEvent(QMouseEvent* e) { contentsMouseEvent(e); } - virtual void contentsMouseDoubleClickEvent(QMouseEvent* e) { contentsMouseEvent(e); } - virtual void contentsWheelEvent(QWheelEvent*); - virtual bool event(QEvent*); + virtual void contentsMousePressEvent(TQMouseEvent* e) { contentsMouseEvent(e); } + virtual void contentsMouseReleaseEvent(TQMouseEvent* e) { contentsMouseEvent(e); } + virtual void contentsMouseMoveEvent(TQMouseEvent* e) { contentsMouseEvent(e); } + virtual void contentsMouseDoubleClickEvent(TQMouseEvent* e) { contentsMouseEvent(e); } + virtual void contentsWheelEvent(TQWheelEvent*); + virtual bool event(TQEvent*); private: - void contentsMouseEvent(QMouseEvent*); + void contentsMouseEvent(TQMouseEvent*); SpinBox* mSpinbox; // spinbox whose spin buttons are being mirrored - QFrame* mSpinFrame; // widget containing mSpinbox's spin buttons - QWidget* mSpinWidget; // spin buttons in mSpinbox - QPixmap mNormalButtons; // image of spin buttons in unpressed state + TQFrame* mSpinFrame; // widget containing mSpinbox's spin buttons + TQWidget* mSpinWidget; // spin buttons in mSpinbox + TQPixmap mNormalButtons; // image of spin buttons in unpressed state bool mReadOnly; // value cannot be changed }; diff --git a/kalarm/lib/synchtimer.cpp b/kalarm/lib/synchtimer.cpp index 1b681d6eb..eecef7d4b 100644 --- a/kalarm/lib/synchtimer.cpp +++ b/kalarm/lib/synchtimer.cpp @@ -19,7 +19,7 @@ */ #include "kalarm.h" -#include <qtimer.h> +#include <tqtimer.h> #include <kdebug.h> #include "synchtimer.moc" @@ -31,7 +31,7 @@ SynchTimer::SynchTimer() { - mTimer = new QTimer(this, "mTimer"); + mTimer = new TQTimer(this, "mTimer"); } SynchTimer::~SynchTimer() @@ -43,16 +43,16 @@ SynchTimer::~SynchTimer() /****************************************************************************** * Connect to the timer. The timer is started if necessary. */ -void SynchTimer::connecT(QObject* receiver, const char* member) +void SynchTimer::connecT(TQObject* receiver, const char* member) { Connection connection(receiver, member); if (mConnections.find(connection) != mConnections.end()) return; // the slot is already connected, so ignore request - connect(mTimer, SIGNAL(timeout()), receiver, member); + connect(mTimer, TQT_SIGNAL(timeout()), receiver, member); mConnections.append(connection); if (!mTimer->isActive()) { - connect(mTimer, SIGNAL(timeout()), this, SLOT(slotTimer())); + connect(mTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimer())); start(); } } @@ -60,7 +60,7 @@ void SynchTimer::connecT(QObject* receiver, const char* member) /****************************************************************************** * Disconnect from the timer. The timer is stopped if no longer needed. */ -void SynchTimer::disconnecT(QObject* receiver, const char* member) +void SynchTimer::disconnecT(TQObject* receiver, const char* member) { if (mTimer) { @@ -69,7 +69,7 @@ void SynchTimer::disconnecT(QObject* receiver, const char* member) mConnections.remove(Connection(receiver, member)); else { - for (QValueList<Connection>::Iterator it = mConnections.begin(); it != mConnections.end(); ) + for (TQValueList<Connection>::Iterator it = mConnections.begin(); it != mConnections.end(); ) { if ((*it).receiver == receiver) it = mConnections.remove(it); @@ -109,7 +109,7 @@ MinuteTimer* MinuteTimer::instance() void MinuteTimer::slotTimer() { kdDebug(5950) << "MinuteTimer::slotTimer()" << endl; - int interval = 62 - QTime::currentTime().second(); + int interval = 62 - TQTime::currentTime().second(); mTimer->start(interval * 1000, true); // execute a single shot } @@ -119,9 +119,9 @@ void MinuteTimer::slotTimer() = Application-wide timer synchronised to midnight. =============================================================================*/ -QValueList<DailyTimer*> DailyTimer::mFixedTimers; +TQValueList<DailyTimer*> DailyTimer::mFixedTimers; -DailyTimer::DailyTimer(const QTime& timeOfDay, bool fixed) +DailyTimer::DailyTimer(const TQTime& timeOfDay, bool fixed) : mTime(timeOfDay), mFixed(fixed) { @@ -135,9 +135,9 @@ DailyTimer::~DailyTimer() mFixedTimers.remove(this); } -DailyTimer* DailyTimer::fixedInstance(const QTime& timeOfDay, bool create) +DailyTimer* DailyTimer::fixedInstance(const TQTime& timeOfDay, bool create) { - for (QValueList<DailyTimer*>::Iterator it = mFixedTimers.begin(); it != mFixedTimers.end(); ++it) + for (TQValueList<DailyTimer*>::Iterator it = mFixedTimers.begin(); it != mFixedTimers.end(); ++it) if ((*it)->mTime == timeOfDay) return *it; return create ? new DailyTimer(timeOfDay, true) : 0; @@ -147,7 +147,7 @@ DailyTimer* DailyTimer::fixedInstance(const QTime& timeOfDay, bool create) * Disconnect from the timer signal which triggers at the given fixed time of day. * If there are no remaining connections to that timer, it is destroyed. */ -void DailyTimer::disconnect(const QTime& timeOfDay, QObject* receiver, const char* member) +void DailyTimer::disconnect(const TQTime& timeOfDay, TQObject* receiver, const char* member) { DailyTimer* timer = fixedInstance(timeOfDay, false); if (!timer) @@ -160,7 +160,7 @@ void DailyTimer::disconnect(const QTime& timeOfDay, QObject* receiver, const cha /****************************************************************************** * Change the time at which the variable timer triggers. */ -void DailyTimer::changeTime(const QTime& newTimeOfDay, bool triggerMissed) +void DailyTimer::changeTime(const TQTime& newTimeOfDay, bool triggerMissed) { if (mFixed) return; @@ -170,7 +170,7 @@ void DailyTimer::changeTime(const QTime& newTimeOfDay, bool triggerMissed) bool triggerNow = false; if (triggerMissed) { - QTime now = QTime::currentTime(); + TQTime now = TQTime::currentTime(); if (now >= newTimeOfDay && now < mTime) { // The trigger time is now earlier and it has already arrived today. @@ -196,7 +196,7 @@ void DailyTimer::changeTime(const QTime& newTimeOfDay, bool triggerMissed) void DailyTimer::start() { // TIMEZONE = local time - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::currentDateTime(); // Find out whether to trigger today or tomorrow. // In preference, use the last trigger date to determine this, since // that will avoid possible errors due to daylight savings time changes. @@ -205,11 +205,11 @@ void DailyTimer::start() today = (mLastDate < now.date()); else today = (now.time() < mTime); - QDateTime next; + TQDateTime next; if (today) - next = QDateTime(now.date(), mTime); + next = TQDateTime(now.date(), mTime); else - next = QDateTime(now.date().addDays(1), mTime); + next = TQDateTime(now.date().addDays(1), mTime); uint interval = next.toTime_t() - now.toTime_t(); mTimer->start(interval * 1000, true); // execute a single shot kdDebug(5950) << "DailyTimer::start(at " << mTime.hour() << ":" << mTime.minute() << "): interval = " << interval/3600 << ":" << (interval/60)%60 << ":" << interval%60 << endl; @@ -224,9 +224,9 @@ void DailyTimer::start() void DailyTimer::slotTimer() { // TIMEZONE = local time - QDateTime now = QDateTime::currentDateTime(); + TQDateTime now = TQDateTime::currentDateTime(); mLastDate = now.date(); - QDateTime next = QDateTime(mLastDate.addDays(1), mTime); + TQDateTime next = TQDateTime(mLastDate.addDays(1), mTime); uint interval = next.toTime_t() - now.toTime_t(); mTimer->start(interval * 1000, true); // execute a single shot kdDebug(5950) << "DailyTimer::slotTimer(at " << mTime.hour() << ":" << mTime.minute() << "): interval = " << interval/3600 << ":" << (interval/60)%60 << ":" << interval%60 << endl; diff --git a/kalarm/lib/synchtimer.h b/kalarm/lib/synchtimer.h index 551fd1687..1860815e7 100644 --- a/kalarm/lib/synchtimer.h +++ b/kalarm/lib/synchtimer.h @@ -23,10 +23,10 @@ /* @file synchtimer.h - timers which synchronise to time boundaries */ -#include <qobject.h> -#include <qvaluelist.h> -#include <qcstring.h> -#include <qdatetime.h> +#include <tqobject.h> +#include <tqvaluelist.h> +#include <tqcstring.h> +#include <tqdatetime.h> class QTimer; /** SynchTimer is a virtual base class for application-wide timers synchronised @@ -43,29 +43,29 @@ class SynchTimer : public QObject struct Connection { Connection() { } - Connection(QObject* r, const char* s) : receiver(r), slot(s) { } + Connection(TQObject* r, const char* s) : receiver(r), slot(s) { } bool operator==(const Connection& c) const { return receiver == c.receiver && slot == c.slot; } - QObject* receiver; - const QCString slot; + TQObject* receiver; + const TQCString slot; }; protected: SynchTimer(); virtual void start() = 0; - void connecT(QObject* receiver, const char* member); - void disconnecT(QObject* receiver, const char* member = 0); + void connecT(TQObject* receiver, const char* member); + void disconnecT(TQObject* receiver, const char* member = 0); bool hasConnections() const { return !mConnections.isEmpty(); } - QTimer* mTimer; + TQTimer* mTimer; protected slots: virtual void slotTimer() = 0; private slots: - void slotReceiverGone(QObject* r) { disconnecT(r); } + void slotReceiverGone(TQObject* r) { disconnecT(r); } private: SynchTimer(const SynchTimer&); // prohibit copying - QValueList<Connection> mConnections; // list of current clients + TQValueList<Connection> mConnections; // list of current clients }; @@ -82,14 +82,14 @@ class MinuteTimer : public SynchTimer * @param receiver Receiving object. * @param member Slot to activate. */ - static void connect(QObject* receiver, const char* member) + static void connect(TQObject* receiver, const char* member) { instance()->connecT(receiver, member); } /** Disconnect from the timer signal. * @param receiver Receiving object. * @param member Slot to disconnect. If null, all slots belonging to * @p receiver will be disconnected. */ - static void disconnect(QObject* receiver, const char* member = 0) + static void disconnect(TQObject* receiver, const char* member = 0) { if (mInstance) mInstance->disconnecT(receiver, member); } protected: @@ -123,7 +123,7 @@ class DailyTimer : public SynchTimer * @param receiver Receiving object. * @param member Slot to activate. */ - static void connect(const QTime& timeOfDay, QObject* receiver, const char* member) + static void connect(const TQTime& timeOfDay, TQObject* receiver, const char* member) { fixedInstance(timeOfDay)->connecT(receiver, member); } /** Disconnect from the timer signal which triggers at the given fixed time of day. * If there are no remaining connections to that timer, it is destroyed. @@ -132,16 +132,16 @@ class DailyTimer : public SynchTimer * @param member Slot to disconnect. If null, all slots belonging to * @p receiver will be disconnected. */ - static void disconnect(const QTime& timeOfDay, QObject* receiver, const char* member = 0); + static void disconnect(const TQTime& timeOfDay, TQObject* receiver, const char* member = 0); /** Change the time at which this variable timer triggers. * @param newTimeOfDay New time at which the timer should trigger. * @param triggerMissed If true, and if @p newTimeOfDay < @p oldTimeOfDay, and if the current * time is between @p newTimeOfDay and @p oldTimeOfDay, the timer will be * triggered immediately so as to avoid missing today's trigger. */ - void changeTime(const QTime& newTimeOfDay, bool triggerMissed = true); + void changeTime(const TQTime& newTimeOfDay, bool triggerMissed = true); /** Return the current time of day at which this variable timer triggers. */ - QTime timeOfDay() const { return mTime; } + TQTime timeOfDay() const { return mTime; } protected: /** Construct an instance. @@ -149,7 +149,7 @@ class DailyTimer : public SynchTimer * can construct instances. This ensures that multiple timers are not created for the same * use. */ - DailyTimer(const QTime&, bool fixed); + DailyTimer(const TQTime&, bool fixed); /** Return the instance which triggers at the specified fixed time of day, * optionally creating a new instance if necessary. * @param timeOfDay Time at which the timer triggers. @@ -157,16 +157,16 @@ class DailyTimer : public SynchTimer * for @p timeOfDay. * @return The instance for @p timeOfDay, or 0 if it does not exist. */ - static DailyTimer* fixedInstance(const QTime& timeOfDay, bool create = true); + static DailyTimer* fixedInstance(const TQTime& timeOfDay, bool create = true); virtual void start(); protected slots: virtual void slotTimer(); private: - static QValueList<DailyTimer*> mFixedTimers; // list of timers whose trigger time is fixed - QTime mTime; - QDate mLastDate; // the date on which the timer was last triggered + static TQValueList<DailyTimer*> mFixedTimers; // list of timers whose trigger time is fixed + TQTime mTime; + TQDate mLastDate; // the date on which the timer was last triggered bool mFixed; // the time at which the timer triggers cannot be changed }; @@ -182,15 +182,15 @@ class MidnightTimer * @param receiver Receiving object. * @param member Slot to activate. */ - static void connect(QObject* receiver, const char* member) - { DailyTimer::connect(QTime(0,0), receiver, member); } + static void connect(TQObject* receiver, const char* member) + { DailyTimer::connect(TQTime(0,0), receiver, member); } /** Disconnect from the timer signal. * @param receiver Receiving object. * @param member Slot to disconnect. If null, all slots belonging to * @p receiver will be disconnected. */ - static void disconnect(QObject* receiver, const char* member = 0) - { DailyTimer::disconnect(QTime(0,0), receiver, member); } + static void disconnect(TQObject* receiver, const char* member = 0) + { DailyTimer::disconnect(TQTime(0,0), receiver, member); } }; diff --git a/kalarm/lib/timeedit.cpp b/kalarm/lib/timeedit.cpp index 8aabb90b6..01152fcee 100644 --- a/kalarm/lib/timeedit.cpp +++ b/kalarm/lib/timeedit.cpp @@ -28,8 +28,8 @@ #include "timeedit.moc" -TimeEdit::TimeEdit(QWidget* parent, const char* name) - : QHBox(parent, name), +TimeEdit::TimeEdit(TQWidget* parent, const char* name) + : TQHBox(parent, name), mAmPm(0), mAmIndex(-1), mPmIndex(-1), @@ -38,13 +38,13 @@ TimeEdit::TimeEdit(QWidget* parent, const char* name) bool use12hour = KGlobal::locale()->use12Clock(); mSpinBox = new TimeSpinBox(!use12hour, this); mSpinBox->setFixedSize(mSpinBox->sizeHint()); - connect(mSpinBox, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int))); + connect(mSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotValueChanged(int))); if (use12hour) { mAmPm = new ComboBox(this); setAmPmCombo(1, 1); // add "am" and "pm" options to the combo box mAmPm->setFixedSize(mAmPm->sizeHint()); - connect(mAmPm, SIGNAL(highlighted(int)), SLOT(slotAmPmChanged(int))); + connect(mAmPm, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotAmPmChanged(int))); } } diff --git a/kalarm/lib/timeedit.h b/kalarm/lib/timeedit.h index 5888c7665..9cbfb6f8c 100644 --- a/kalarm/lib/timeedit.h +++ b/kalarm/lib/timeedit.h @@ -21,8 +21,8 @@ #ifndef TIMEEDIT_H #define TIMEEDIT_H -#include <qdatetime.h> -#include <qhbox.h> +#include <tqdatetime.h> +#include <tqhbox.h> class ComboBox; class TimeSpinBox; @@ -55,7 +55,7 @@ class TimeEdit : public QHBox * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit TimeEdit(QWidget* parent = 0, const char* name = 0); + explicit TimeEdit(TQWidget* parent = 0, const char* name = 0); /** Returns true if the widget is read only. */ bool isReadOnly() const { return mReadOnly; } /** Sets whether the widget is read-only for the user. If read-only, @@ -74,8 +74,8 @@ class TimeEdit : public QHBox void setValid(bool valid); /** Returns the entered time as a value in minutes. */ int value() const; - /** Returns the entered time as a QTime value. */ - QTime time() const { int m = value(); return QTime(m/60, m%60); } + /** Returns the entered time as a TQTime value. */ + TQTime time() const { int m = value(); return TQTime(m/60, m%60); } /** Returns true if it is possible to step the value from the highest value to the lowest value and vice versa. */ bool wrapping() const; /** Sets whether it is possible to step the value from the highest value to the lowest value and vice versa. @@ -86,19 +86,19 @@ class TimeEdit : public QHBox int minValue() const; /** Returns the maximum value of the widget in minutes. */ int maxValue() const; - /** Returns the maximum value of the widget as a QTime value. */ - QTime maxTime() const { int mv = maxValue(); return QTime(mv/60, mv%60); } + /** Returns the maximum value of the widget as a TQTime value. */ + TQTime maxTime() const { int mv = maxValue(); return TQTime(mv/60, mv%60); } /** Sets the minimum value of the widget. */ void setMinValue(int minutes); /** Sets the maximum value of the widget. */ void setMaxValue(int minutes); /** Sets the maximum value of the widget. */ - void setMaxValue(const QTime& time) { setMaxValue(time.hour()*60 + time.minute()); } + void setMaxValue(const TQTime& time) { setMaxValue(time.hour()*60 + time.minute()); } public slots: /** Sets the value of the widget. */ virtual void setValue(int minutes); /** Sets the value of the widget. */ - void setValue(const QTime& t) { setValue(t.hour()*60 + t.minute()); } + void setValue(const TQTime& t) { setValue(t.hour()*60 + t.minute()); } signals: /** This signal is emitted every time the value of the widget changes * (for whatever reason). diff --git a/kalarm/lib/timeperiod.cpp b/kalarm/lib/timeperiod.cpp index 22a7c3179..e372615a7 100644 --- a/kalarm/lib/timeperiod.cpp +++ b/kalarm/lib/timeperiod.cpp @@ -20,8 +20,8 @@ #include "kalarm.h" -#include <qwidgetstack.h> -#include <qwhatsthis.h> +#include <tqwidgetstack.h> +#include <tqwhatsthis.h> #include <klocale.h> #include <kdialog.h> @@ -34,14 +34,14 @@ // Collect these widget labels together to ensure consistent wording and // translations across different modules. -QString TimePeriod::i18n_minutes() { return i18n("minutes"); } -QString TimePeriod::i18n_Minutes() { return i18n("Minutes"); } -QString TimePeriod::i18n_hours_mins() { return i18n("hours/minutes"); } -QString TimePeriod::i18n_Hours_Mins() { return i18n("Hours/Minutes"); } -QString TimePeriod::i18n_days() { return i18n("days"); } -QString TimePeriod::i18n_Days() { return i18n("Days"); } -QString TimePeriod::i18n_weeks() { return i18n("weeks"); } -QString TimePeriod::i18n_Weeks() { return i18n("Weeks"); } +TQString TimePeriod::i18n_minutes() { return i18n("minutes"); } +TQString TimePeriod::i18n_Minutes() { return i18n("Minutes"); } +TQString TimePeriod::i18n_hours_mins() { return i18n("hours/minutes"); } +TQString TimePeriod::i18n_Hours_Mins() { return i18n("Hours/Minutes"); } +TQString TimePeriod::i18n_days() { return i18n("days"); } +TQString TimePeriod::i18n_Days() { return i18n("Days"); } +TQString TimePeriod::i18n_weeks() { return i18n("weeks"); } +TQString TimePeriod::i18n_Weeks() { return i18n("Weeks"); } static const int maxMinutes = 1000*60-1; // absolute maximum value for hours:minutes = 999H59M @@ -50,25 +50,25 @@ static const int maxMinutes = 1000*60-1; // absolute maximum value for hours:m = Contains a time unit combo box, plus a time spinbox, to select a time period. =============================================================================*/ -TimePeriod::TimePeriod(bool allowHourMinute, QWidget* parent, const char* name) - : QHBox(parent, name), +TimePeriod::TimePeriod(bool allowHourMinute, TQWidget* parent, const char* name) + : TQHBox(parent, name), mMaxDays(9999), mNoHourMinute(!allowHourMinute), mReadOnly(false) { setSpacing(KDialog::spacingHint()); - mSpinStack = new QWidgetStack(this); + mSpinStack = new TQWidgetStack(this); mSpinBox = new SpinBox(mSpinStack); mSpinBox->setLineStep(1); mSpinBox->setLineShiftStep(10); mSpinBox->setRange(1, mMaxDays); - connect(mSpinBox, SIGNAL(valueChanged(int)), SLOT(slotDaysChanged(int))); + connect(mSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotDaysChanged(int))); mSpinStack->addWidget(mSpinBox, 0); mTimeSpinBox = new TimeSpinBox(0, 99999, mSpinStack); mTimeSpinBox->setRange(1, maxMinutes); // max 999H59M - connect(mTimeSpinBox, SIGNAL(valueChanged(int)), SLOT(slotTimeChanged(int))); + connect(mTimeSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotTimeChanged(int))); mSpinStack->addWidget(mTimeSpinBox, 1); mSpinStack->setFixedSize(mSpinBox->sizeHint().expandedTo(mTimeSpinBox->sizeHint())); @@ -88,7 +88,7 @@ TimePeriod::TimePeriod(bool allowHourMinute, QWidget* parent, const char* name) mUnitsCombo->insertItem(i18n_weeks()); mMaxUnitShown = WEEKS; mUnitsCombo->setFixedSize(mUnitsCombo->sizeHint()); - connect(mUnitsCombo, SIGNAL(activated(int)), SLOT(slotUnitsSelected(int))); + connect(mUnitsCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotUnitsSelected(int))); setFocusProxy(mUnitsCombo); setTabOrder(mUnitsCombo, mSpinStack); @@ -376,9 +376,9 @@ void TimePeriod::showHourMin(bool hourMinute) * If the hours:minutes text is omitted, both spinboxes are set to the same * WhatsThis text. */ -void TimePeriod::setWhatsThis(const QString& units, const QString& dayWeek, const QString& hourMin) +void TimePeriod::setWhatsThis(const TQString& units, const TQString& dayWeek, const TQString& hourMin) { - QWhatsThis::add(mUnitsCombo, units); - QWhatsThis::add(mSpinBox, dayWeek); - QWhatsThis::add(mTimeSpinBox, (hourMin.isNull() ? dayWeek : hourMin)); + TQWhatsThis::add(mUnitsCombo, units); + TQWhatsThis::add(mSpinBox, dayWeek); + TQWhatsThis::add(mTimeSpinBox, (hourMin.isNull() ? dayWeek : hourMin)); } diff --git a/kalarm/lib/timeperiod.h b/kalarm/lib/timeperiod.h index ef1a3b5c3..2f9513dcd 100644 --- a/kalarm/lib/timeperiod.h +++ b/kalarm/lib/timeperiod.h @@ -21,8 +21,8 @@ #ifndef TIMEPERIOD_H #define TIMEPERIOD_H -#include <qhbox.h> -#include <qstring.h> +#include <tqhbox.h> +#include <tqstring.h> class QWidgetStack; class ComboBox; @@ -67,7 +67,7 @@ class TimePeriod : public QHBox * @param parent The parent object of this widget. * @param name The name of this widget. */ - TimePeriod(bool allowMinute, QWidget* parent, const char* name = 0); + TimePeriod(bool allowMinute, TQWidget* parent, const char* name = 0); /** Returns true if the widget is read only. */ bool isReadOnly() const { return mReadOnly; } /** Sets whether the widget is read-only for the user. If read-only, @@ -103,16 +103,16 @@ class TimePeriod : public QHBox /** Sets separate WhatsThis texts for the count spin boxes and the units combo box. * If @p hourMin is omitted, both spin boxes are set to the same WhatsThis text. */ - void setWhatsThis(const QString& units, const QString& dayWeek, const QString& hourMin = QString::null); + void setWhatsThis(const TQString& units, const TQString& dayWeek, const TQString& hourMin = TQString::null); - static QString i18n_minutes(); // text of 'minutes' units, lower case - static QString i18n_Minutes(); // text of 'Minutes' units, initial capitals - static QString i18n_hours_mins(); // text of 'hours/minutes' units, lower case - static QString i18n_Hours_Mins(); // text of 'Hours/Minutes' units, initial capitals - static QString i18n_days(); // text of 'days' units, lower case - static QString i18n_Days(); // text of 'Days' units, initial capital - static QString i18n_weeks(); // text of 'weeks' units, lower case - static QString i18n_Weeks(); // text of 'Weeks' units, initial capital + static TQString i18n_minutes(); // text of 'minutes' units, lower case + static TQString i18n_Minutes(); // text of 'Minutes' units, initial capitals + static TQString i18n_hours_mins(); // text of 'hours/minutes' units, lower case + static TQString i18n_Hours_Mins(); // text of 'Hours/Minutes' units, initial capitals + static TQString i18n_days(); // text of 'days' units, lower case + static TQString i18n_Days(); // text of 'Days' units, initial capital + static TQString i18n_weeks(); // text of 'weeks' units, lower case + static TQString i18n_Weeks(); // text of 'Weeks' units, initial capital signals: /** This signal is emitted whenever the value held in the widget changes. @@ -131,7 +131,7 @@ class TimePeriod : public QHBox void showHourMin(bool hourMin); void adjustDayWeekShown(); - QWidgetStack* mSpinStack; // displays either the days/weeks or hours:minutes spinbox + TQWidgetStack* mSpinStack; // displays either the days/weeks or hours:minutes spinbox SpinBox* mSpinBox; // the minutes/days/weeks value spinbox TimeSpinBox* mTimeSpinBox; // the hours:minutes value spinbox ComboBox* mUnitsCombo; diff --git a/kalarm/lib/timespinbox.cpp b/kalarm/lib/timespinbox.cpp index 7a22cd230..20073d878 100644 --- a/kalarm/lib/timespinbox.cpp +++ b/kalarm/lib/timespinbox.cpp @@ -20,8 +20,8 @@ #include "kalarm.h" -#include <qvalidator.h> -#include <qlineedit.h> +#include <tqvalidator.h> +#include <tqlineedit.h> #include <klocale.h> #include "timespinbox.moc" @@ -30,10 +30,10 @@ class TimeSpinBox::TimeValidator : public QValidator { public: - TimeValidator(int minMin, int maxMin, QWidget* parent, const char* name = 0) - : QValidator(parent, name), + TimeValidator(int minMin, int maxMin, TQWidget* parent, const char* name = 0) + : TQValidator(parent, name), minMinute(minMin), maxMinute(maxMin), m12Hour(false), mPm(false) { } - virtual State validate(QString&, int&) const; + virtual State validate(TQString&, int&) const; int minMinute, maxMinute; bool m12Hour; bool mPm; @@ -54,7 +54,7 @@ class TimeSpinBox::TimeValidator : public QValidator /****************************************************************************** * Construct a wrapping 00:00 - 23:59, or 12:00 - 11:59 time spin box. */ -TimeSpinBox::TimeSpinBox(bool use24hour, QWidget* parent, const char* name) +TimeSpinBox::TimeSpinBox(bool use24hour, TQWidget* parent, const char* name) : SpinBox2(0, 1439, 1, 60, parent, name), mMinimumValue(0), m12Hour(!use24hour), @@ -70,13 +70,13 @@ TimeSpinBox::TimeSpinBox(bool use24hour, QWidget* parent, const char* name) setShiftSteps(5, 360); // shift-left button increments 5 min / 6 hours setSelectOnStep(false); setAlignment(Qt::AlignHCenter); - connect(this, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int))); + connect(this, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotValueChanged(int))); } /****************************************************************************** * Construct a non-wrapping time spin box. */ -TimeSpinBox::TimeSpinBox(int minMinute, int maxMinute, QWidget* parent, const char* name) +TimeSpinBox::TimeSpinBox(int minMinute, int maxMinute, TQWidget* parent, const char* name) : SpinBox2(minMinute, maxMinute, 1, 60, parent, name), mMinimumValue(minMinute), m12Hour(false), @@ -88,20 +88,20 @@ TimeSpinBox::TimeSpinBox(int minMinute, int maxMinute, QWidget* parent, const ch setReverseWithLayout(false); // keep buttons the same way round even if right-to-left language setShiftSteps(5, 300); // shift-left button increments 5 min / 5 hours setSelectOnStep(false); - setAlignment(QApplication::reverseLayout() ? Qt::AlignLeft : Qt::AlignRight); + setAlignment(TQApplication::reverseLayout() ? Qt::AlignLeft : Qt::AlignRight); } -QString TimeSpinBox::shiftWhatsThis() +TQString TimeSpinBox::shiftWhatsThis() { return i18n("Press the Shift key while clicking the spin buttons to adjust the time by a larger step (6 hours / 5 minutes)."); } -QTime TimeSpinBox::time() const +TQTime TimeSpinBox::time() const { - return QTime(value() / 60, value() % 60); + return TQTime(value() / 60, value() % 60); } -QString TimeSpinBox::mapValueToText(int v) +TQString TimeSpinBox::mapValueToText(int v) { if (m12Hour) { @@ -110,7 +110,7 @@ QString TimeSpinBox::mapValueToText(int v) else if (v >= 780) v -= 720; // convert 13 - 23 hours to 1 - 11 } - QString s; + TQString s; s.sprintf((wrapping() ? "%02d:%02d" : "%d:%02d"), v/60, v%60); return s; } @@ -123,13 +123,13 @@ QString TimeSpinBox::mapValueToText(int v) */ int TimeSpinBox::mapTextToValue(bool* ok) { - QString text = cleanText(); + TQString text = cleanText(); int colon = text.find(':'); if (colon >= 0) { // [h]:m format for any time value - QString hour = text.left(colon).stripWhiteSpace(); - QString minute = text.mid(colon + 1).stripWhiteSpace(); + TQString hour = text.left(colon).stripWhiteSpace(); + TQString minute = text.mid(colon + 1).stripWhiteSpace(); if (!minute.isEmpty()) { bool okmin; @@ -204,14 +204,14 @@ void TimeSpinBox::setValid(bool valid) mInvalid = false; if (value() < mMinimumValue) SpinBox2::setValue(mMinimumValue); - setSpecialValueText(QString()); + setSpecialValueText(TQString()); SpinBox2::setMinValue(mMinimumValue); } else if (!valid && !mInvalid) { mInvalid = true; SpinBox2::setMinValue(mMinimumValue - 1); - setSpecialValueText(QString::fromLatin1("**:**")); + setSpecialValueText(TQString::fromLatin1("**:**")); SpinBox2::setValue(mMinimumValue - 1); } } @@ -241,7 +241,7 @@ void TimeSpinBox::setValue(int minutes) if (mInvalid) { mInvalid = false; - setSpecialValueText(QString()); + setSpecialValueText(TQString()); SpinBox2::setMinValue(mMinimumValue); } SpinBox2::setValue(minutes); @@ -280,18 +280,18 @@ void TimeSpinBox::slotValueChanged(int value) mPm = mValidator->mPm = (value >= 720); } -QSize TimeSpinBox::sizeHint() const +TQSize TimeSpinBox::sizeHint() const { - QSize sz = SpinBox2::sizeHint(); - QFontMetrics fm(font()); - return QSize(sz.width() + fm.width(":"), sz.height()); + TQSize sz = SpinBox2::sizeHint(); + TQFontMetrics fm(font()); + return TQSize(sz.width() + fm.width(":"), sz.height()); } -QSize TimeSpinBox::minimumSizeHint() const +TQSize TimeSpinBox::minimumSizeHint() const { - QSize sz = SpinBox2::minimumSizeHint(); - QFontMetrics fm(font()); - return QSize(sz.width() + fm.width(":"), sz.height()); + TQSize sz = SpinBox2::minimumSizeHint(); + TQFontMetrics fm(font()); + return TQSize(sz.width() + fm.width(":"), sz.height()); } /****************************************************************************** @@ -299,24 +299,24 @@ QSize TimeSpinBox::minimumSizeHint() const * The entered time must either be 4 digits, or it must contain a colon, but * hours may be blank. */ -QValidator::State TimeSpinBox::TimeValidator::validate(QString& text, int& /*cursorPos*/) const +TQValidator::State TimeSpinBox::TimeValidator::validate(TQString& text, int& /*cursorPos*/) const { - QString cleanText = text.stripWhiteSpace(); + TQString cleanText = text.stripWhiteSpace(); if (cleanText.isEmpty()) - return QValidator::Intermediate; - QValidator::State state = QValidator::Acceptable; - QString hour; + return TQValidator::Intermediate; + TQValidator::State state = TQValidator::Acceptable; + TQString hour; bool ok; int hr = 0; int mn = 0; int colon = cleanText.find(':'); if (colon >= 0) { - QString minute = cleanText.mid(colon + 1); + TQString minute = cleanText.mid(colon + 1); if (minute.isEmpty()) - state = QValidator::Intermediate; + state = TQValidator::Intermediate; else if ((mn = minute.toUInt(&ok)) >= 60 || !ok) - return QValidator::Invalid; + return TQValidator::Invalid; hour = cleanText.left(colon); } @@ -324,19 +324,19 @@ QValidator::State TimeSpinBox::TimeValidator::validate(QString& text, int& /*cur { // The hhmm form of entry is only allowed for time-of-day, i.e. <= 2359 hour = cleanText; - state = QValidator::Intermediate; + state = TQValidator::Intermediate; } else { if (cleanText.length() > 4) - return QValidator::Invalid; + return TQValidator::Invalid; if (cleanText.length() < 4) - state = QValidator::Intermediate; + state = TQValidator::Intermediate; hour = cleanText.left(2); - QString minute = cleanText.mid(2); + TQString minute = cleanText.mid(2); if (!minute.isEmpty() && ((mn = minute.toUInt(&ok)) >= 60 || !ok)) - return QValidator::Invalid; + return TQValidator::Invalid; } if (!hour.isEmpty()) @@ -352,13 +352,13 @@ QValidator::State TimeSpinBox::TimeValidator::validate(QString& text, int& /*cur hr += 12; // convert to PM } if (!ok || hr > maxMinute/60) - return QValidator::Invalid; + return TQValidator::Invalid; } - if (state == QValidator::Acceptable) + if (state == TQValidator::Acceptable) { int t = hr * 60 + mn; if (t < minMinute || t > maxMinute) - return QValidator::Invalid; + return TQValidator::Invalid; } return state; } diff --git a/kalarm/lib/timespinbox.h b/kalarm/lib/timespinbox.h index 275fdf309..909541ad9 100644 --- a/kalarm/lib/timespinbox.h +++ b/kalarm/lib/timespinbox.h @@ -21,7 +21,7 @@ #ifndef TIMESPINBOX_H #define TIMESPINBOX_H -#include <qdatetime.h> +#include <tqdatetime.h> #include "spinbox2.h" @@ -52,14 +52,14 @@ class TimeSpinBox : public SpinBox2 * @param parent The parent object of this widget. * @param name The name of this widget. */ - explicit TimeSpinBox(bool use24hour, QWidget* parent = 0, const char* name = 0); + explicit TimeSpinBox(bool use24hour, TQWidget* parent = 0, const char* name = 0); /** Constructor for a non-wrapping time spin box which can be used to enter a length of time. * @param minMinute The minimum value which the spin box can hold, in minutes. * @param maxMinute The maximum value which the spin box can hold, in minutes. * @param parent The parent object of this widget. * @param name The name of this widget. */ - TimeSpinBox(int minMinute, int maxMinute, QWidget* parent = 0, const char* name = 0); + TimeSpinBox(int minMinute, int maxMinute, TQWidget* parent = 0, const char* name = 0); /** Returns true if the spin box holds a valid value. * An invalid value is displayed as asterisks. */ @@ -72,7 +72,7 @@ class TimeSpinBox : public SpinBox2 /** Returns the current value held in the spin box. * If an invalid value is displayed, returns a value lower than the minimum value. */ - QTime time() const; + TQTime time() const; /** Sets the maximum value which can be held in the spin box. * @param minutes The maximum value expressed in minutes. */ @@ -82,16 +82,16 @@ class TimeSpinBox : public SpinBox2 */ virtual void setMaxValue(int minutes) { SpinBox2::setMaxValue(minutes); } /** Sets the maximum value which can be held in the spin box. */ - void setMaxValue(const QTime& t) { SpinBox2::setMaxValue(t.hour()*60 + t.minute()); } + void setMaxValue(const TQTime& t) { SpinBox2::setMaxValue(t.hour()*60 + t.minute()); } /** Returns the maximum value which can be held in the spin box. */ - QTime maxTime() const { int mv = maxValue(); return QTime(mv/60, mv%60); } + TQTime maxTime() const { int mv = maxValue(); return TQTime(mv/60, mv%60); } /** Returns a text describing use of the shift key as an accelerator for * the spin buttons, designed for incorporation into WhatsThis texts. */ - static QString shiftWhatsThis(); + static TQString shiftWhatsThis(); - virtual QSize sizeHint() const; - virtual QSize minimumSizeHint() const; + virtual TQSize sizeHint() const; + virtual TQSize minimumSizeHint() const; public slots: /** Sets the value of the spin box. @@ -99,7 +99,7 @@ class TimeSpinBox : public SpinBox2 */ virtual void setValue(int minutes); /** Sets the value of the spin box. */ - void setValue(const QTime& t) { setValue(t.hour()*60 + t.minute()); } + void setValue(const TQTime& t) { setValue(t.hour()*60 + t.minute()); } /** Increments the spin box value. * If the value was previously invalid, the spin box is set to the minimum value. */ @@ -110,7 +110,7 @@ class TimeSpinBox : public SpinBox2 virtual void stepDown(); protected: - virtual QString mapValueToText(int v); + virtual TQString mapValueToText(int v); virtual int mapTextToValue(bool* ok); private slots: void slotValueChanged(int value); |