Diffstat (limited to 'pwmanager/pwmanager/pwmtray.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/pwmtray.h | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/pwmanager/pwmanager/pwmtray.h b/pwmanager/pwmanager/pwmtray.h index ffb625e..b1145e0 100644 --- a/pwmanager/pwmanager/pwmtray.h +++ b/pwmanager/pwmanager/pwmtray.h | |||
@@ -27,7 +27,10 @@ | |||
27 | #include <kpopupmenu.h> | 27 | #include <kpopupmenu.h> |
28 | 28 | ||
29 | #include <qpainter.h> | 29 | #include <qpainter.h> |
30 | #include <qvaluelist.h> | 30 | #include <q3valuelist.h> |
31 | //Added by qt3to4: | ||
32 | #include <QMouseEvent> | ||
33 | #include <QMenuItem> | ||
31 | 34 | ||
32 | //#include "pwmexception.h" | 35 | //#include "pwmexception.h" |
33 | 36 | ||
@@ -36,8 +39,7 @@ class PwMDoc; | |||
36 | class PwMTray; | 39 | class PwMTray; |
37 | 40 | ||
38 | /* wrapper to workaround MOC problems */ | 41 | /* wrapper to workaround MOC problems */ |
39 | class __ActiveTreeItem : public QCustomMenuItem | 42 | class __ActiveTreeItem : public QMenuItem |
40 | , public QObject | ||
41 | { | 43 | { |
42 | public: | 44 | public: |
43 | __ActiveTreeItem() {} | 45 | __ActiveTreeItem() {} |
@@ -87,14 +89,14 @@ public: | |||
87 | bool /*enabled*/, int x, int y, int w, int h) | 89 | bool /*enabled*/, int x, int y, int w, int h) |
88 | { | 90 | { |
89 | p->setFont(font); | 91 | p->setFont(font); |
90 | p->drawText(x, y, w, h, AlignLeft | AlignVCenter | | 92 | p->drawText(x, y, w, h, Qt::AlignLeft | Qt::AlignVCenter | |
91 | DontClip | ShowPrefix, text); | 93 | Qt::DontClip | Qt::ShowPrefix, text); |
92 | } | 94 | } |
93 | 95 | ||
94 | QSize sizeHint() | 96 | QSize sizeHint() |
95 | { | 97 | { |
96 | return QFontMetrics(font).size(AlignLeft | AlignVCenter | | 98 | return QFontMetrics(font).size(Qt::AlignLeft | Qt::AlignVCenter | |
97 | ShowPrefix | DontClip, text); | 99 | Qt::ShowPrefix | Qt::DontClip, text); |
98 | } | 100 | } |
99 | 101 | ||
100 | bool fullSpan() const | 102 | bool fullSpan() const |
@@ -122,7 +124,7 @@ protected: | |||
122 | 124 | ||
123 | /** tray icon implementation */ | 125 | /** tray icon implementation */ |
124 | #ifndef PWM_EMBEDDED | 126 | #ifndef PWM_EMBEDDED |
125 | //MOC_SKIP_BEGIN | 127 | #ifndef Q_MOC_RUN |
126 | class PwMTray : public KSystemTray | 128 | class PwMTray : public KSystemTray |
127 | { | 129 | { |
128 | Q_OBJECT | 130 | Q_OBJECT |
@@ -134,7 +136,7 @@ class PwMTray : public KSystemTray | |||
134 | int menuId; | 136 | int menuId; |
135 | PwMDoc *doc; | 137 | PwMDoc *doc; |
136 | KPopupMenu *menu; | 138 | KPopupMenu *menu; |
137 | QValueList<int> activeItems; // ids of all active items | 139 | Q3ValueList<int> activeItems; // ids of all active items |
138 | }; | 140 | }; |
139 | 141 | ||
140 | public: | 142 | public: |
@@ -170,7 +172,7 @@ protected: | |||
170 | /** holds a list of all open files, its documents and | 172 | /** holds a list of all open files, its documents and |
171 | * its menuIDs | 173 | * its menuIDs |
172 | */ | 174 | */ |
173 | QValueList<struct treeItem> tree; | 175 | Q3ValueList<struct treeItem> tree; |
174 | /** pointer to init */ | 176 | /** pointer to init */ |
175 | PwMInit *init; | 177 | PwMInit *init; |
176 | 178 | ||
@@ -185,7 +187,7 @@ protected: | |||
185 | void buildMain(); | 187 | void buildMain(); |
186 | /** rebuilds the tree for the given KPopupMenu entry */ | 188 | /** rebuilds the tree for the given KPopupMenu entry */ |
187 | void rebuildTree(KPopupMenu *popup, PwMDoc *doc, | 189 | void rebuildTree(KPopupMenu *popup, PwMDoc *doc, |
188 | QValueList<int> *activeItems); | 190 | Q3ValueList<int> *activeItems); |
189 | /** insert a new tree-entry for the given doc and returns the ID.*/ | 191 | /** insert a new tree-entry for the given doc and returns the ID.*/ |
190 | int insertTreeEntry(PwMDoc *doc, KPopupMenu **popup); | 192 | int insertTreeEntry(PwMDoc *doc, KPopupMenu **popup); |
191 | /** removes a tree entry */ | 193 | /** removes a tree entry */ |
@@ -194,7 +196,7 @@ protected: | |||
194 | void insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, | 196 | void insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, |
195 | ActiveTreeItem::Task task, PwMDoc *doc, | 197 | ActiveTreeItem::Task task, PwMDoc *doc, |
196 | int docCategory, int docEntry, | 198 | int docCategory, int docEntry, |
197 | QValueList<int> *activeItemsList); | 199 | Q3ValueList<int> *activeItemsList); |
198 | /** mouse event on icon */ | 200 | /** mouse event on icon */ |
199 | void mouseReleaseEvent(QMouseEvent *e); | 201 | void mouseReleaseEvent(QMouseEvent *e); |
200 | /** inserts the items for the main window control | 202 | /** inserts the items for the main window control |
@@ -202,7 +204,7 @@ protected: | |||
202 | */ | 204 | */ |
203 | void insertMainWndCtrl(KPopupMenu *menu, PwMDoc *doc); | 205 | void insertMainWndCtrl(KPopupMenu *menu, PwMDoc *doc); |
204 | }; | 206 | }; |
205 | //MOC_SKIP_END | 207 | #endif |
206 | #else | 208 | #else |
207 | class PwMTray : public QWidget | 209 | class PwMTray : public QWidget |
208 | { | 210 | { |
@@ -215,7 +217,7 @@ class PwMTray : public QWidget | |||
215 | int menuId; | 217 | int menuId; |
216 | PwMDoc *doc; | 218 | PwMDoc *doc; |
217 | KPopupMenu *menu; | 219 | KPopupMenu *menu; |
218 | QValueList<int> activeItems; // ids of all active items | 220 | Q3ValueList<int> activeItems; // ids of all active items |
219 | }; | 221 | }; |
220 | 222 | ||
221 | public: | 223 | public: |
@@ -255,7 +257,7 @@ protected: | |||
255 | /** holds a list of all open files, its documents and | 257 | /** holds a list of all open files, its documents and |
256 | * its menuIDs | 258 | * its menuIDs |
257 | */ | 259 | */ |
258 | QValueList<struct treeItem> tree; | 260 | Q3ValueList<struct treeItem> tree; |
259 | /** pointer to init */ | 261 | /** pointer to init */ |
260 | PwMInit *init; | 262 | PwMInit *init; |
261 | 263 | ||
@@ -270,7 +272,7 @@ protected: | |||
270 | void buildMain(); | 272 | void buildMain(); |
271 | /** rebuilds the tree for the given KPopupMenu entry */ | 273 | /** rebuilds the tree for the given KPopupMenu entry */ |
272 | void rebuildTree(KPopupMenu *popup, PwMDoc *doc, | 274 | void rebuildTree(KPopupMenu *popup, PwMDoc *doc, |
273 | QValueList<int> *activeItems); | 275 | Q3ValueList<int> *activeItems); |
274 | /** insert a new tree-entry for the given doc and returns the ID.*/ | 276 | /** insert a new tree-entry for the given doc and returns the ID.*/ |
275 | int insertTreeEntry(PwMDoc *doc, KPopupMenu **popup); | 277 | int insertTreeEntry(PwMDoc *doc, KPopupMenu **popup); |
276 | /** removes a tree entry */ | 278 | /** removes a tree entry */ |
@@ -279,7 +281,7 @@ protected: | |||
279 | void insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, | 281 | void insertActiveTreeItem(KPopupMenu *insertIn, const QString &text, |
280 | ActiveTreeItem::Task task, PwMDoc *doc, | 282 | ActiveTreeItem::Task task, PwMDoc *doc, |
281 | int docCategory, int docEntry, | 283 | int docCategory, int docEntry, |
282 | QValueList<int> *activeItemsList); | 284 | Q3ValueList<int> *activeItemsList); |
283 | /** mouse event on icon */ | 285 | /** mouse event on icon */ |
284 | void mouseReleaseEvent(QMouseEvent *e); | 286 | void mouseReleaseEvent(QMouseEvent *e); |
285 | /** inserts the items for the main window control | 287 | /** inserts the items for the main window control |