From 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 30 Jun 2011 00:15:53 +0000 Subject: 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 --- src/common/gui/key_gui.h | 58 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'src/common/gui/key_gui.h') diff --git a/src/common/gui/key_gui.h b/src/common/gui/key_gui.h index fb8a9f5..5ae0a84 100644 --- a/src/common/gui/key_gui.h +++ b/src/common/gui/key_gui.h @@ -9,9 +9,9 @@ #ifndef KEY_GUI_H #define KEY_GUI_H -#include -#include -#include +#include +#include +#include #include "common/gui/misc_gui.h" #include "common/common/misc.h" @@ -21,10 +21,10 @@ template class KeyWidget { public: - typedef QMapConstIterator ConstIterator; + typedef TQMapConstIterator ConstIterator; public: - KeyWidget(QWidget *parent) { _widget = new WidgetType(parent); } + KeyWidget(TQWidget *tqparent) { _widget = new WidgetType(tqparent); } virtual ~KeyWidget() { delete _widget; } virtual WidgetType *widget() { return _widget; } virtual void clear() { _ids.clear(); } @@ -32,16 +32,16 @@ public: ConstIterator end() const { return _ids.end(); } uint count() const { return _ids.count(); } void appendItem(const KeyType &key, Type type) { - CRASH_ASSERT( !_ids.contains(key) ); + CRASH_ASSERT( !_ids.tqcontains(key) ); _ids[key] = append(type); } KeyType currentItem() const { return key(currentId()); } void setCurrentItem(const KeyType &key) { - if ( _ids.contains(key) ) setCurrentId(_ids[key]); + if ( _ids.tqcontains(key) ) setCurrentId(_ids[key]); } - bool contains(const KeyType &key) const { return _ids.contains(key); } + bool tqcontains(const KeyType &key) const { return _ids.tqcontains(key); } Type item(const KeyType &key) const { - CRASH_ASSERT( _ids.contains(key) ); + CRASH_ASSERT( _ids.tqcontains(key) ); return get(_ids[key]); } Type item(ConstIterator it) const { @@ -60,64 +60,64 @@ protected: virtual void setCurrentId(int id) = 0; virtual Type get(int id) const = 0; - QWidget *_parent; - QMap _ids; + TQWidget *_parent; + TQMap _ids; WidgetType *_widget; }; //----------------------------------------------------------------------------- template -class KeyComboBox : public KeyWidget +class KeyComboBox : public KeyWidget { public: - typedef KeyWidget ParentType; - KeyComboBox(QWidget *parent = 0) : ParentType(parent) {} + typedef KeyWidget ParentType; + KeyComboBox(TQWidget *tqparent = 0) : ParentType(tqparent) {} virtual void clear() { ParentType::clear(); ParentType::_widget->clear(); } void fixMinimumWidth() { - ParentType::_widget->setMinimumWidth(ParentType::_widget->sizeHint().width()); + ParentType::_widget->setMinimumWidth(ParentType::_widget->tqsizeHint().width()); } protected: - virtual int append(QString label) { ParentType::_widget->insertItem(label); return ParentType::_widget->count()-1; } + virtual int append(TQString label) { ParentType::_widget->insertItem(label); return ParentType::_widget->count()-1; } virtual int currentId() const { return ParentType::_widget->currentItem(); } virtual void setCurrentId(int id) { ParentType::_widget->setCurrentItem(id); } - virtual QString get(int id) const { return ParentType::_widget->text(id); } + virtual TQString get(int id) const { return ParentType::_widget->text(id); } }; //----------------------------------------------------------------------------- template -class KeyWidgetStack : public KeyWidget +class KeyWidgetStack : public KeyWidget { public: - typedef KeyWidget ParentType; - KeyWidgetStack(QWidget *parent = 0) : ParentType(parent) {} + typedef KeyWidget ParentType; + KeyWidgetStack(TQWidget *tqparent = 0) : ParentType(tqparent) {} protected: - virtual int append(QWidget *widget) { return ParentType::_widget->addWidget(widget); } + virtual int append(TQWidget *widget) { return ParentType::_widget->addWidget(widget); } virtual int currentId() const { return ParentType::_widget->id(ParentType::_widget->visibleWidget()); } virtual void setCurrentId(int id) { ParentType::_widget->raiseWidget(id); } - virtual QWidget *get(int id) const { return ParentType::_widget->widget(id); } + virtual TQWidget *get(int id) const { return ParentType::_widget->widget(id); } }; //----------------------------------------------------------------------------- template -class KeyPopupButton : public KeyWidget +class KeyPopupButton : public KeyWidget { public: - typedef KeyWidget ParentType; - KeyPopupButton(QWidget *parent = 0) : ParentType(parent) {} + typedef KeyWidget ParentType; + KeyPopupButton(TQWidget *tqparent = 0) : ParentType(tqparent) {} protected: - virtual int append(QString label) { return ParentType::_widget->appendItem(label, QPixmap()); } - virtual QString get(int id) const { return ParentType::_widget->popup()->text(id); } + virtual int append(TQString label) { return ParentType::_widget->appendItem(label, TQPixmap()); } + virtual TQString get(int id) const { return ParentType::_widget->popup()->text(id); } private: // disabled - QString currentItem() const; - void setCurrentItem(const QString &key); + TQString currentItem() const; + void setCurrentItem(const TQString &key); virtual int currentId() const { return 0; } virtual void setCurrentId(int) {} }; -- cgit v1.2.3