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/purl_gui.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/purl_gui.h')
-rw-r--r-- | src/common/gui/purl_gui.h | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/src/common/gui/purl_gui.h b/src/common/gui/purl_gui.h index a11bedf..d554636 100644 --- a/src/common/gui/purl_gui.h +++ b/src/common/gui/purl_gui.h @@ -9,7 +9,7 @@ #ifndef PURL_GUI_H #define PURL_GUI_H -#include <qvgroupbox.h> +#include <tqvgroupbox.h> #include <klineedit.h> #include <klocale.h> #include <kurllabel.h> @@ -21,34 +21,36 @@ namespace PURL { //----------------------------------------------------------------------------- extern bool hasMimetype(FileType type); -extern QPixmap icon(FileType type); -extern Directory getExistingDirectory(const QString &startDir, QWidget *widget, const QString &caption); -extern Url getOpenUrl(const QString &startDir, const QString &filter, QWidget *widget, - const QString &caption); -extern UrlList getOpenUrls(const QString &startDir, const QString &filter, QWidget *widget, - const QString &caption); +extern TQPixmap icon(FileType type); +extern Directory getExistingDirectory(const TQString &startDir, TQWidget *widget, const TQString &caption); +extern Url getOpenUrl(const TQString &startDir, const TQString &filter, TQWidget *widget, + const TQString &caption); +extern UrlList getOpenUrls(const TQString &startDir, const TQString &filter, TQWidget *widget, + const TQString &caption); enum SaveAction { NoSaveAction, AskOverwrite, CancelIfExists }; -extern Url getSaveUrl(const QString &startDir, const QString &filter, QWidget *widget, - const QString &caption, SaveAction action); +extern Url getSaveUrl(const TQString &startDir, const TQString &filter, TQWidget *widget, + const TQString &caption, SaveAction action); //----------------------------------------------------------------------------- class Label : public KURLLabel { Q_OBJECT + TQ_OBJECT public: - Label(const QString &url, const QString &text, QWidget *parent = 0, const char *name = 0); + Label(const TQString &url, const TQString &text, TQWidget *tqparent = 0, const char *name = 0); private slots: void urlClickedSlot(); }; //----------------------------------------------------------------------------- -class BaseWidget : public QWidget +class BaseWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - BaseWidget(QWidget *parent = 0, const char *name = 0); - BaseWidget(const QString &defaultDir, QWidget *parent = 0, const char *name = 0); + BaseWidget(TQWidget *tqparent = 0, const char *name = 0); + BaseWidget(const TQString &defaultDir, TQWidget *tqparent = 0, const char *name = 0); KLineEdit *lineEdit() { return _edit; } signals: @@ -58,7 +60,7 @@ protected slots: virtual void buttonClicked() = 0; protected: - QString _defaultDir; + TQString _defaultDir; KLineEdit *_edit; void init(); @@ -68,9 +70,10 @@ protected: class DirectoryWidget : public BaseWidget { Q_OBJECT + TQ_OBJECT public: - DirectoryWidget(QWidget *parent = 0, const char *name = 0) : BaseWidget(parent, name) {} - DirectoryWidget(const QString &defaultDir, QWidget *parent = 0, const char *name = 0) : BaseWidget(defaultDir, parent, name) {} + DirectoryWidget(TQWidget *tqparent = 0, const char *name = 0) : BaseWidget(tqparent, name) {} + DirectoryWidget(const TQString &defaultDir, TQWidget *tqparent = 0, const char *name = 0) : BaseWidget(defaultDir, tqparent, name) {} void setDirectory(const Directory &dir) { _edit->setText(dir.path()); } Directory directory() const { return _edit->text(); } @@ -79,32 +82,34 @@ protected slots: }; //----------------------------------------------------------------------------- -class DirectoriesWidget : public QVGroupBox +class DirectoriesWidget : public TQVGroupBox { Q_OBJECT + TQ_OBJECT public: - DirectoriesWidget(const QString &title, QWidget *parent = 0, const char *name = 0); - DirectoriesWidget(const QString &title, const QString &defaultDir, QWidget *parent = 0, const char *name = 0); - void setDirectories(const QStringList &dirs) { _editListBox->setTexts(dirs); } - QStringList directories() const { return _editListBox->texts(); } + DirectoriesWidget(const TQString &title, TQWidget *tqparent = 0, const char *name = 0); + DirectoriesWidget(const TQString &title, const TQString &defaultDir, TQWidget *tqparent = 0, const char *name = 0); + void setDirectories(const TQStringList &dirs) { _editListBox->setTexts(dirs); } + TQStringList directories() const { return _editListBox->texts(); } signals: void changed(); private: EditListBox *_editListBox; - void init(const QString &defaultDir); + void init(const TQString &defaultDir); }; //----------------------------------------------------------------------------- class UrlWidget : public BaseWidget { Q_OBJECT + TQ_OBJECT public: - UrlWidget(const QString &filter, QWidget *parent = 0, const char *name = 0) - : BaseWidget(parent, name), _filter(filter) {} - UrlWidget(const QString &defaultDir, const QString &filter, QWidget *parent = 0, const char *name = 0) - : BaseWidget(defaultDir, parent, name), _filter(filter) {} + UrlWidget(const TQString &filter, TQWidget *tqparent = 0, const char *name = 0) + : BaseWidget(tqparent, name), _filter(filter) {} + UrlWidget(const TQString &defaultDir, const TQString &filter, TQWidget *tqparent = 0, const char *name = 0) + : BaseWidget(defaultDir, tqparent, name), _filter(filter) {} Url url() const { return PURL::Url::fromPathOrUrl(_edit->text()); } void setUrl(const Url &url) { _edit->setText(url.filepath()); } @@ -112,7 +117,7 @@ protected slots: virtual void buttonClicked(); private: - QString _filter; + TQString _filter; }; } // namespace |