author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdeui/ktoolbarbutton.h | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'microkde/kdeui/ktoolbarbutton.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kdeui/ktoolbarbutton.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/microkde/kdeui/ktoolbarbutton.h b/microkde/kdeui/ktoolbarbutton.h index 9aaa13c..ad02e4e 100644 --- a/microkde/kdeui/ktoolbarbutton.h +++ b/microkde/kdeui/ktoolbarbutton.h | |||
@@ -13,41 +13,44 @@ | |||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | Library General Public License for more details. | 15 | Library General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU Library General Public License | 17 | You should have received a copy of the GNU Library General Public License |
18 | along with this library; see the file COPYING.LIB. If not, write to | 18 | along with this library; see the file COPYING.LIB. If not, write to |
19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. | 20 | Boston, MA 02111-1307, USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | // $Id$ | 23 | // $Id$ |
24 | #ifndef _KTOOLBARBUTTON_H | 24 | #ifndef _KTOOLBARBUTTON_H |
25 | #define _KTOOLBARBUTTON_H | 25 | #define _KTOOLBARBUTTON_H |
26 | 26 | ||
27 | #include <qpixmap.h> | 27 | #include <qpixmap.h> |
28 | #include <qtoolbutton.h> | 28 | #include <qtoolbutton.h> |
29 | #include <qintdict.h> | 29 | #include <q3intdict.h> |
30 | #include <qstring.h> | 30 | #include <qstring.h> |
31 | //Added by qt3to4: | ||
32 | #include <QEvent> | ||
33 | #include <Q3PopupMenu> | ||
31 | #include <kglobal.h> | 34 | #include <kglobal.h> |
32 | 35 | ||
33 | class KToolBar; | 36 | class KToolBar; |
34 | class KToolBarButtonPrivate; | 37 | class KToolBarButtonPrivate; |
35 | //USclass KInstance; | 38 | //USclass KInstance; |
36 | class QEvent; | 39 | class QEvent; |
37 | class QPopupMenu; | 40 | class Q3PopupMenu; |
38 | class QPainter; | 41 | class QPainter; |
39 | 42 | ||
40 | /** | 43 | /** |
41 | * A toolbar button. This is used internally by @ref KToolBar, use the | 44 | * A toolbar button. This is used internally by @ref KToolBar, use the |
42 | * KToolBar methods instead. | 45 | * KToolBar methods instead. |
43 | * @internal | 46 | * @internal |
44 | */ | 47 | */ |
45 | class KToolBarButton : public QToolButton | 48 | class KToolBarButton : public QToolButton |
46 | { | 49 | { |
47 | Q_OBJECT | 50 | Q_OBJECT |
48 | 51 | ||
49 | public: | 52 | public: |
50 | /** | 53 | /** |
51 | * Construct a button with an icon loaded by the button itself. | 54 | * Construct a button with an icon loaded by the button itself. |
52 | * This will trust the button to load the correct icon with the | 55 | * This will trust the button to load the correct icon with the |
53 | * correct size. | 56 | * correct size. |
@@ -137,33 +140,33 @@ public: | |||
137 | * with the correct size. This function is preferred over @ref setIconSet | 140 | * with the correct size. This function is preferred over @ref setIconSet |
138 | * | 141 | * |
139 | * @param icon The name of the icon | 142 | * @param icon The name of the icon |
140 | */ | 143 | */ |
141 | virtual void setIcon(const QString &icon); | 144 | virtual void setIcon(const QString &icon); |
142 | 145 | ||
143 | /// @since 3.1 | 146 | /// @since 3.1 |
144 | virtual void setIcon( const QPixmap &pixmap ) | 147 | virtual void setIcon( const QPixmap &pixmap ) |
145 | { QToolButton::setIcon( pixmap ); } | 148 | { QToolButton::setIcon( pixmap ); } |
146 | 149 | ||
147 | /** | 150 | /** |
148 | * Set the pixmaps for this toolbar button from a QIconSet. | 151 | * Set the pixmaps for this toolbar button from a QIconSet. |
149 | * If you call this you don't need to call any of the other methods | 152 | * If you call this you don't need to call any of the other methods |
150 | * that set icons or pixmaps. | 153 | * that set icons or pixmaps. |
151 | * @param iconset The iconset to use | 154 | * @param iconset The iconset to use |
152 | */ | 155 | */ |
153 | virtual void setIconSet( const QIconSet &iconset ); | 156 | virtual void setIconSet( const QIcon &iconset ); |
154 | 157 | ||
155 | #ifndef KDE_NO_COMPAT | 158 | #ifndef KDE_NO_COMPAT |
156 | /** | 159 | /** |
157 | * @deprecated | 160 | * @deprecated |
158 | * Set the active icon for this button. The pixmap itself is loaded | 161 | * Set the active icon for this button. The pixmap itself is loaded |
159 | * internally based on the icon size... .. the disabled and default | 162 | * internally based on the icon size... .. the disabled and default |
160 | * pixmaps, however will only be constructed if @ref #generate is | 163 | * pixmaps, however will only be constructed if @ref #generate is |
161 | * true. This function is preferred over @ref setPixmap | 164 | * true. This function is preferred over @ref setPixmap |
162 | * | 165 | * |
163 | * @param icon The name of the active icon | 166 | * @param icon The name of the active icon |
164 | * @param generate If true, then the other icons are automagically | 167 | * @param generate If true, then the other icons are automagically |
165 | * generated from this one | 168 | * generated from this one |
166 | */ | 169 | */ |
167 | void setIcon(const QString &icon, bool /*generate*/ ) { setIcon( icon ); } | 170 | void setIcon(const QString &icon, bool /*generate*/ ) { setIcon( icon ); } |
168 | 171 | ||
169 | /** | 172 | /** |
@@ -196,59 +199,59 @@ public: | |||
196 | * Toggle this button | 199 | * Toggle this button |
197 | */ | 200 | */ |
198 | void toggle(); | 201 | void toggle(); |
199 | 202 | ||
200 | /** | 203 | /** |
201 | * Turn this button into a toggle button or disable the toggle | 204 | * Turn this button into a toggle button or disable the toggle |
202 | * aspects of it. This does not toggle the button itself. | 205 | * aspects of it. This does not toggle the button itself. |
203 | * Use @ref toggle() for that. | 206 | * Use @ref toggle() for that. |
204 | * | 207 | * |
205 | * @param toggle true or false | 208 | * @param toggle true or false |
206 | */ | 209 | */ |
207 | void setToggle(bool toggle = true); | 210 | void setToggle(bool toggle = true); |
208 | 211 | ||
209 | /** | 212 | /** |
210 | * Return a pointer to this button's popup menu (if it exists) | 213 | * Return a pointer to this button's popup menu (if it exists) |
211 | */ | 214 | */ |
212 | QPopupMenu *popup(); | 215 | QMenu *popup(); |
213 | 216 | ||
214 | /** | 217 | /** |
215 | * Returns the button's id. | 218 | * Returns the button's id. |
216 | * @since 3.2 | 219 | * @since 3.2 |
217 | */ | 220 | */ |
218 | int id() const; | 221 | int id() const; |
219 | 222 | ||
220 | /** | 223 | /** |
221 | * Give this button a popup menu. There will not be a delay when | 224 | * Give this button a popup menu. There will not be a delay when |
222 | * you press the button. Use @ref setDelayedPopup if you want that | 225 | * you press the button. Use @ref setDelayedPopup if you want that |
223 | * behavior. | 226 | * behavior. |
224 | * | 227 | * |
225 | * @param p The new popup menu | 228 | * @param p The new popup menu |
226 | */ | 229 | */ |
227 | void setPopup (QPopupMenu *p, bool unused = false); | 230 | void setPopup (Q3PopupMenu *p, bool unused = false); |
228 | 231 | ||
229 | /** | 232 | /** |
230 | * Gives this button a delayed popup menu. | 233 | * Gives this button a delayed popup menu. |
231 | * | 234 | * |
232 | * This function allows you to add a delayed popup menu to the button. | 235 | * This function allows you to add a delayed popup menu to the button. |
233 | * The popup menu is then only displayed when the button is pressed and | 236 | * The popup menu is then only displayed when the button is pressed and |
234 | * held down for about half a second. | 237 | * held down for about half a second. |
235 | * | 238 | * |
236 | * @param p the new popup menu | 239 | * @param p the new popup menu |
237 | */ | 240 | */ |
238 | void setDelayedPopup(QPopupMenu *p, bool unused = false); | 241 | void setDelayedPopup(Q3PopupMenu *p, bool unused = false); |
239 | 242 | ||
240 | /** | 243 | /** |
241 | * Turn this button into a radio button | 244 | * Turn this button into a radio button |
242 | * | 245 | * |
243 | * @param f true or false | 246 | * @param f true or false |
244 | */ | 247 | */ |
245 | void setRadio(bool f = true); | 248 | void setRadio(bool f = true); |
246 | 249 | ||
247 | /** | 250 | /** |
248 | * Toolbar buttons naturally will assume the global styles | 251 | * Toolbar buttons naturally will assume the global styles |
249 | * concerning icons, icons sizes, etc. You can use this function to | 252 | * concerning icons, icons sizes, etc. You can use this function to |
250 | * explicitely turn this off, if you like. | 253 | * explicitely turn this off, if you like. |
251 | * | 254 | * |
252 | * @param no_style Will disable styles if true | 255 | * @param no_style Will disable styles if true |
253 | */ | 256 | */ |
254 | void setNoStyle(bool no_style = true); | 257 | void setNoStyle(bool no_style = true); |
@@ -290,24 +293,24 @@ protected slots: | |||
290 | void slotPressed(); | 293 | void slotPressed(); |
291 | void slotReleased(); | 294 | void slotReleased(); |
292 | void slotToggled(); | 295 | void slotToggled(); |
293 | void slotDelayTimeout(); | 296 | void slotDelayTimeout(); |
294 | 297 | ||
295 | protected: | 298 | protected: |
296 | virtual void virtual_hook( int id, void* data ); | 299 | virtual void virtual_hook( int id, void* data ); |
297 | private: | 300 | private: |
298 | KToolBarButtonPrivate *d; | 301 | KToolBarButtonPrivate *d; |
299 | }; | 302 | }; |
300 | 303 | ||
301 | /** | 304 | /** |
302 | * List of @ref KToolBarButton objects. | 305 | * List of @ref KToolBarButton objects. |
303 | * @internal | 306 | * @internal |
304 | * @version $Id$ | 307 | * @version $Id$ |
305 | */ | 308 | */ |
306 | class KToolBarButtonList : public QIntDict<KToolBarButton> | 309 | class KToolBarButtonList : public Q3IntDict<KToolBarButton> |
307 | { | 310 | { |
308 | public: | 311 | public: |
309 | KToolBarButtonList(); | 312 | KToolBarButtonList(); |
310 | ~KToolBarButtonList() {} | 313 | ~KToolBarButtonList() {} |
311 | }; | 314 | }; |
312 | 315 | ||
313 | #endif | 316 | #endif |