diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
commit | 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch) | |
tree | b95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/common/gui/config_widget.h | |
parent | b79a2c28534cf09987eeeba3077fff9236df182a (diff) | |
download | piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip |
TQt4 port piklab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/common/gui/config_widget.h')
-rw-r--r-- | src/common/gui/config_widget.h | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/src/common/gui/config_widget.h b/src/common/gui/config_widget.h index abfafab..787780b 100644 --- a/src/common/gui/config_widget.h +++ b/src/common/gui/config_widget.h @@ -10,10 +10,10 @@ #ifndef CONFIG_WIDGET_H #define CONFIG_WIDGET_H -#include <qpixmap.h> -#include <qcheckbox.h> -#include <qvaluevector.h> -#include <qvariant.h> +#include <tqpixmap.h> +#include <tqcheckbox.h> +#include <tqvaluevector.h> +#include <tqvariant.h> #include "container.h" @@ -21,11 +21,12 @@ class ConfigWidget : public Container { Q_OBJECT + TQ_OBJECT public: - ConfigWidget(QWidget *parent = 0) : Container(parent) {} - virtual QString title() const { return QString::null; } - virtual QString header() const { return QString::null; } - virtual QPixmap pixmap() const { return QPixmap(); } + ConfigWidget(TQWidget *tqparent = 0) : Container(tqparent) {} + virtual TQString title() const { return TQString(); } + virtual TQString header() const { return TQString(); } + virtual TQPixmap pixmap() const { return TQPixmap(); } public slots: virtual void loadConfig() = 0; @@ -52,40 +53,40 @@ public: } private: - QValueVector<QWidget *> _widgets; + TQValueVector<TQWidget *> _widgets; - static QWidget *createWidget(Type type, ConfigWidget *widget) { - QWidget *w = 0; + static TQWidget *createWidget(Type type, ConfigWidget *widget) { + TQWidget *w = 0; uint row = widget->numRows(); switch (type.data().defValue.type()) { - case QVariant::Bool: - w = new QCheckBox(type.label(), widget); + case TQVariant::Bool: + w = new TQCheckBox(type.label(), widget); widget->addWidget(w, row,row, 0,1); break; default: Q_ASSERT(false); break; } return w; } - void load(Type type, QWidget *widget) const { + void load(Type type, TQWidget *widget) const { switch (type.data().defValue.type()) { - case QVariant::Bool: - static_cast<QCheckBox *>(widget)->setChecked(readConfigEntry(type).toBool()); + case TQVariant::Bool: + static_cast<TQCheckBox *>(widget)->setChecked(readConfigEntry(type).toBool()); break; default: Q_ASSERT(false); break; } } - void save(Type type, QWidget *widget) { + void save(Type type, TQWidget *widget) { switch (type.data().defValue.type()) { - case QVariant::Bool: - writeConfigEntry(type, QVariant(static_cast<QCheckBox *>(widget)->isChecked(), 0)); + case TQVariant::Bool: + writeConfigEntry(type, TQVariant(static_cast<TQCheckBox *>(widget)->isChecked(), 0)); break; default: Q_ASSERT(false); break; } } - void setDefault(Type type, QWidget *widget) const { + void setDefault(Type type, TQWidget *widget) const { switch (type.data().defValue.type()) { - case QVariant::Bool: - static_cast<QCheckBox *>(widget)->setChecked(type.data().defValue.toBool()); + case TQVariant::Bool: + static_cast<TQCheckBox *>(widget)->setChecked(type.data().defValue.toBool()); break; default: Q_ASSERT(false); break; } |