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/libgui/editor_manager.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/libgui/editor_manager.h')
-rw-r--r-- | src/libgui/editor_manager.h | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/src/libgui/editor_manager.h b/src/libgui/editor_manager.h index 0d180b9..8c5f626 100644 --- a/src/libgui/editor_manager.h +++ b/src/libgui/editor_manager.h @@ -10,7 +10,7 @@ #ifndef EDITOR_MANAGER_H #define EDITOR_MANAGER_H -class QEvent; +class TQEvent; #include <ktabbar.h> #include <ktabwidget.h> #include <klineedit.h> @@ -23,9 +23,10 @@ class QEvent; class SwitchToDialog : public Dialog { Q_OBJECT + TQ_OBJECT public: - SwitchToDialog(const QStringList &names, QWidget *parent); - QString name() const { return _edit->text(); } + SwitchToDialog(const TQStringList &names, TQWidget *tqparent); + TQString name() const { return _edit->text(); } private: KLineEdit *_edit; @@ -35,13 +36,14 @@ private: class EditorTabBar : public TabBar { Q_OBJECT + TQ_OBJECT public: - EditorTabBar(QWidget *parent) : TabBar(parent, "editor_tab_bar") {} + EditorTabBar(TQWidget *tqparent) : TabBar(tqparent, "editor_tab_bar") {} void setReadOnly(uint index, bool readOnly) { _readOnly[tabAt(index)] = readOnly; } private: - QMap<QTab *, bool> _readOnly; - virtual void paintLabel(QPainter *p, const QRect &br, QTab *t, bool has_focus) const; + TQMap<TQTab *, bool> _readOnly; + virtual void paintLabel(TQPainter *p, const TQRect &br, TQTab *t, bool has_focus) const; }; //----------------------------------------------------------------------------- @@ -51,31 +53,32 @@ public: EditorHistory() : _current(0) {} bool hasBack() const { return _current!=0; } bool hasForward() const { return (_current+1)<_names.count(); } - void add(const QString &name); + void add(const TQString &name); void closedLast(); - QString goBack(); - QString goForward(); + TQString goBack(); + TQString goForward(); private: uint _current; - QValueVector<QString> _names; + TQValueVector<TQString> _names; }; //----------------------------------------------------------------------------- class EditorManager : public TabWidget { Q_OBJECT + TQ_OBJECT public: - EditorManager(QWidget *parent); + EditorManager(TQWidget *tqparent); PURL::UrlList files() const; - QValueList<Editor *> &editors() { return _editors; } + TQValueList<Editor *> &editors() { return _editors; } uint nbEditors() const { return _editors.count(); } Editor *createEditor(PURL::FileType type, const PURL::Url &url); void addEditor(Editor *e); Editor *currentEditor() const { return _current; } Editor *findEditor(const PURL::Url &file); - Editor *findEditor(const QString &tag); + Editor *findEditor(const TQString &tag); void showEditor(Editor *e); bool closeEditor(const PURL::Url &url); bool closeEditor(Editor *e, bool ask); @@ -89,7 +92,7 @@ public: public slots: void updateTitles(); - void slotDropEvent(QDropEvent *e); + void slotDropEvent(TQDropEvent *e); void saveAllFiles(); bool closeCurrentEditor(); bool closeAllEditors(); @@ -102,25 +105,25 @@ public slots: signals: void modified(const PURL::Url &url); void guiChanged(); - void statusChanged(const QString &); + void statusChanged(const TQString &); private: void changeToEditor(Editor *e); void enableActions(bool enable); - QString title(const Editor &e) const; - QString name(const Editor &e) const; - virtual void contextMenu(int i, const QPoint &p); + TQString title(const Editor &e) const; + TQString name(const Editor &e) const; + virtual void contextMenu(int i, const TQPoint &p); void saveBookmarks(const Editor &e); void restoreBookmarks(Editor &e); private slots: - void showEditor(QWidget *w) { showEditor(static_cast<Editor *>(w)); } + void showEditor(TQWidget *w) { showEditor(static_cast<Editor *>(w)); } void closeRequest(int i); void modifiedSlot(); private: Editor *_current; - QValueList<Editor *> _editors; + TQValueList<Editor *> _editors; EditorHistory _history; static const char * const EDITOR_TAGS[Nb_EditorTypes]; }; |