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/misc_gui.h | 86 +++++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 40 deletions(-) (limited to 'src/common/gui/misc_gui.h') diff --git a/src/common/gui/misc_gui.h b/src/common/gui/misc_gui.h index 2d58569..7003f91 100644 --- a/src/common/gui/misc_gui.h +++ b/src/common/gui/misc_gui.h @@ -9,12 +9,12 @@ #ifndef MISC_GUI_H #define MISC_GUI_H -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -29,11 +29,11 @@ class KAction; #include "common/common/number.h" //----------------------------------------------------------------------------- -class BusyCursor +class PBusyCursor { public: - BusyCursor() { start(); } - ~BusyCursor() { stop(); } + PBusyCursor() { start(); } + ~PBusyCursor() { stop(); } static void start(); static void stop(); static void pause(); @@ -46,32 +46,33 @@ private: //----------------------------------------------------------------------------- namespace MessageBox { -extern void information(const QString &text, Log::ShowMode show, const QString &dontShowAgainName = QString::null); -extern void detailedSorry(const QString &text, const QString &details, Log::ShowMode show); -inline void sorry(const QString &text, Log::ShowMode show) { detailedSorry(text, QString::null, show); } -extern bool askContinue(const QString &text, const KGuiItem &continueButton = KStdGuiItem::cont(), - const QString &caption = i18n("Warning")); -extern bool questionYesNo(const QString &text, const KGuiItem &yesButton, const KGuiItem &noButton, - const QString &caption = i18n("Warning")); +extern void information(const TQString &text, Log::ShowMode show, const TQString &dontShowAgainName = TQString()); +extern void detailedSorry(const TQString &text, const TQString &details, Log::ShowMode show); +inline void sorry(const TQString &text, Log::ShowMode show) { detailedSorry(text, TQString(), show); } +extern bool askContinue(const TQString &text, const KGuiItem &continueButton = KStdGuiItem::cont(), + const TQString &caption = i18n("Warning")); +extern bool questionYesNo(const TQString &text, const KGuiItem &yesButton, const KGuiItem &noButton, + const TQString &caption = i18n("Warning")); enum Result { Yes, No, Cancel }; -extern Result questionYesNoCancel(const QString &text, const KGuiItem &yesButton, const KGuiItem &noButton, - const QString &caption = i18n("Warning")); -extern void text(const QString &text, Log::ShowMode show); +extern Result questionYesNoCancel(const TQString &text, const KGuiItem &yesButton, const KGuiItem &noButton, + const TQString &caption = i18n("Warning")); +extern void text(const TQString &text, Log::ShowMode show); } //---------------------------------------------------------------------------- class PopupButton : public KPushButton { Q_OBJECT + TQ_OBJECT public: - PopupButton(QWidget *parent = 0, const char *name = 0); - PopupButton(const QString &text, QWidget *parent = 0, const char *name = 0); + PopupButton(TQWidget *tqparent = 0, const char *name = 0); + PopupButton(const TQString &text, TQWidget *tqparent = 0, const char *name = 0); void appendAction(KAction *action); - void appendAction(const QString &label, const QString &icon = QString::null, - QObject *receiver = 0, const char *slot = 0); - int appendItem(const QString &label, uint id) { return appendItem(label, QPixmap(), id); } - int appendItem(const QString &label, const QString &icon, int id = -1); - int appendItem(const QString &label, const QPixmap &icon, int id = -1); + void appendAction(const TQString &label, const TQString &icon = TQString(), + TQObject *receiver = 0, const char *slot = 0); + int appendItem(const TQString &label, uint id) { return appendItem(label, TQPixmap(), id); } + int appendItem(const TQString &label, const TQString &icon, int id = -1); + int appendItem(const TQString &label, const TQPixmap &icon, int id = -1); void appendSeparator() { _separator = true; } signals: @@ -84,19 +85,20 @@ private: }; //----------------------------------------------------------------------------- -class Splitter : public QSplitter +class Splitter : public TQSplitter { Q_OBJECT + TQ_OBJECT public: - Splitter(const QValueList &defaultSizes, Orientation orientation, - QWidget *parent, const char *name); + Splitter(const TQValueList &defaultSizes, Qt::Orientation orientation, + TQWidget *tqparent, const char *name); virtual ~Splitter(); private slots: void updateSizes(); private: - QValueList _defaultSizes; + TQValueList _defaultSizes; }; //----------------------------------------------------------------------------- @@ -107,12 +109,13 @@ public: }; //----------------------------------------------------------------------------- -class SeparatorWidget : public QFrame +class SeparatorWidget : public TQFrame { Q_OBJECT + TQ_OBJECT public: - SeparatorWidget(QWidget *parent) : QFrame(parent, "separator") { - setFrameStyle(QFrame::Panel | QFrame::Sunken); + SeparatorWidget(TQWidget *tqparent) : TQFrame(tqparent, "separator") { + setFrameStyle(TQFrame::Panel | TQFrame::Sunken); setMargin(2); setFixedHeight(2*2); } @@ -122,11 +125,12 @@ public: class TabBar : public KTabBar { Q_OBJECT + TQ_OBJECT public: - TabBar(QWidget *parent = 0, const char *name = 0); + TabBar(TQWidget *tqparent = 0, const char *name = 0); protected: - virtual void wheelEvent(QWheelEvent *e); + virtual void wheelEvent(TQWheelEvent *e); private: bool _ignoreWheelEvent; @@ -137,25 +141,27 @@ private: class TabWidget : public KTabWidget { Q_OBJECT + TQ_OBJECT public: - TabWidget(QWidget *parent = 0, const char *name = 0); + TabWidget(TQWidget *tqparent = 0, const char *name = 0); void setIgnoreWheelEvent(bool ignore); protected: - virtual void wheelEvent(QWheelEvent *e); + virtual void wheelEvent(TQWheelEvent *e); void setTabBar(TabBar *tabbar); }; //----------------------------------------------------------------------------- -class ComboBox : public QComboBox +class ComboBox : public TQComboBox { Q_OBJECT + TQ_OBJECT public: - ComboBox(QWidget *parent = 0, const char *name = 0); + ComboBox(TQWidget *tqparent = 0, const char *name = 0); void setIgnoreWheelEvent(bool ignore) { _ignoreWheelEvent = ignore; } protected: - virtual void wheelEvent(QWheelEvent *e); + virtual void wheelEvent(TQWheelEvent *e); private: bool _ignoreWheelEvent; -- cgit v1.2.1