source: trunk/doc/html/qtoolbutton-h.html@ 190

Last change on this file since 190 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 7.5 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qtoolbutton.h:1 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>qtoolbutton.h Include File</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qtoolbutton.h</h1>
33
34<p>This is the verbatim text of the qtoolbutton.h include file. It is provided only for illustration; the copyright remains with Trolltech.
35<hr>
36<pre>
37/****************************************************************************
38** $Id: qtoolbutton-h.html 2051 2007-02-21 10:04:20Z chehrlic $
39**
40** Definition of QToolButton class
41**
42** Created : 979899
43**
44** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
45**
46** This file is part of the widgets module of the Qt GUI Toolkit.
47**
48** This file may be distributed under the terms of the Q Public License
49** as defined by Trolltech ASA of Norway and appearing in the file
50** LICENSE.QPL included in the packaging of this file.
51**
52** This file may be distributed and/or modified under the terms of the
53** GNU General Public License version 2 as published by the Free Software
54** Foundation and appearing in the file LICENSE.GPL included in the
55** packaging of this file.
56**
57** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
58** licenses may use this file in accordance with the Qt Commercial License
59** Agreement provided with the Software.
60**
61** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
62** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
63**
64** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
65** information about Qt Commercial License Agreements.
66** See http://www.trolltech.com/qpl/ for QPL licensing information.
67** See http://www.trolltech.com/gpl/ for GPL licensing information.
68**
69** Contact info@trolltech.com if any conditions of this licensing are
70** not clear to you.
71**
72**********************************************************************/
73
74#ifndef QTOOLBUTTON_H
75#define QTOOLBUTTON_H
76
77#ifndef QT_H
78#include "qbutton.h"
79#include "qstring.h"
80#include "qpixmap.h"
81#include "qiconset.h"
82#endif // QT_H
83
84#ifndef QT_NO_TOOLBUTTON
85
86class QToolButtonPrivate;
87class QToolBar;
88class QPopupMenu;
89
90class Q_EXPORT QToolButton : public QButton
91{
92 Q_OBJECT
93 Q_ENUMS( TextPosition )
94
95 Q_PROPERTY( QIconSet iconSet READ iconSet WRITE setIconSet )
96 Q_PROPERTY( QIconSet onIconSet READ onIconSet WRITE setOnIconSet DESIGNABLE false STORED false )
97 Q_PROPERTY( QIconSet offIconSet READ offIconSet WRITE setOffIconSet DESIGNABLE false STORED false )
98 Q_PROPERTY( bool usesBigPixmap READ usesBigPixmap WRITE setUsesBigPixmap )
99 Q_PROPERTY( bool usesTextLabel READ usesTextLabel WRITE setUsesTextLabel )
100 Q_PROPERTY( QString textLabel READ textLabel WRITE setTextLabel )
101 Q_PROPERTY( int popupDelay READ popupDelay WRITE setPopupDelay )
102 Q_PROPERTY( bool autoRaise READ autoRaise WRITE setAutoRaise )
103 Q_PROPERTY( TextPosition textPosition READ textPosition WRITE setTextPosition )
104
105 Q_OVERRIDE( bool toggleButton WRITE setToggleButton )
106 Q_OVERRIDE( bool on WRITE setOn )
107 Q_OVERRIDE( QPixmap pixmap DESIGNABLE false STORED false )
108 Q_OVERRIDE( BackgroundMode backgroundMode DESIGNABLE true)
109
110public:
111 enum TextPosition {
112 BesideIcon,
113 BelowIcon,
114 Right = BesideIcon, // obsolete
115 Under = BelowIcon // obsolete
116 };
117 QToolButton( QWidget * parent, const char* name=0 );
118#ifndef QT_NO_TOOLBAR
119 QToolButton( const QIconSet&amp; s, const QString &amp;textLabel,
120 const QString&amp; grouptext,
121 QObject * receiver, const char* slot,
122 QToolBar * parent, const char* name=0 );
123#endif
124 QToolButton( ArrowType type, QWidget *parent, const char* name=0 );
125 ~QToolButton();
126
127 QSize sizeHint() const;
128 QSize minimumSizeHint() const;
129
130#ifndef QT_NO_COMPAT
131 void setOnIconSet( const QIconSet&amp; );
132 void setOffIconSet( const QIconSet&amp; );
133 void setIconSet( const QIconSet &amp;, bool on );
134 QIconSet onIconSet() const;
135 QIconSet offIconSet( ) const;
136 QIconSet iconSet( bool on ) const;
137#endif
138 virtual void setIconSet( const QIconSet &amp; );
139 QIconSet iconSet() const;
140
141 bool usesBigPixmap() const { return ubp; }
142 bool usesTextLabel() const { return utl; }
143 QString textLabel() const { return tl; }
144
145#ifndef QT_NO_POPUPMENU
146 void setPopup( QPopupMenu* popup );
147 QPopupMenu* popup() const;
148
149 void setPopupDelay( int delay );
150 int popupDelay() const;
151
152 void openPopup();
153#endif
154
155 void setAutoRaise( bool enable );
156 bool autoRaise() const;
157 TextPosition textPosition() const;
158
159 void setText( const QString &amp;txt );
160
161public slots:
162 virtual void setUsesBigPixmap( bool enable );
163 virtual void setUsesTextLabel( bool enable );
164 virtual void setTextLabel( const QString &amp;, bool );
165
166 virtual void setToggleButton( bool enable );
167
168 virtual void setOn( bool enable );
169 void toggle();
170 void setTextLabel( const QString &amp; );
171 void setTextPosition( TextPosition pos );
172
173protected:
174 void mousePressEvent( QMouseEvent * );
175 void drawButton( QPainter * );
176 void drawButtonLabel(QPainter *);
177
178 void enterEvent( QEvent * );
179 void leaveEvent( QEvent * );
180 void moveEvent( QMoveEvent * );
181
182 // ### Make virtual in 4.0, maybe act like QPushButton with
183 // regards to setFlat() instead? Andy
184 bool uses3D() const;
185#if (QT_VERSION &gt;= 0x040000)
186#error "Some functions need to be changed to virtual for Qt 4.0"
187#endif
188
189 bool eventFilter( QObject *o, QEvent *e );
190
191#ifndef QT_NO_PALETTE
192 void paletteChange( const QPalette &amp; );
193#endif
194
195private slots:
196 void popupTimerDone();
197 void popupPressed();
198
199private:
200 void init();
201
202 QPixmap bp;
203 int bpID;
204 QPixmap sp;
205 int spID;
206
207 QString tl;
208
209 QToolButtonPrivate *d;
210 QIconSet *s;
211
212 uint utl : 1;
213 uint ubp : 1;
214 uint hasArrow : 1;
215
216private: // Disabled copy constructor and operator=
217#if defined(Q_DISABLE_COPY)
218 QToolButton( const QToolButton &amp; );
219 QToolButton&amp; operator=( const QToolButton &amp; );
220#endif
221};
222
223#endif // QT_NO_TOOLBUTTON
224
225#endif // QTOOLBUTTON_H
226</pre>
227<!-- eof -->
228<p><address><hr><div align=center>
229<table width=100% cellspacing=0 border=0><tr>
230<td>Copyright &copy; 2007
231<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
232<td align=right><div align=right>Qt 3.3.8</div>
233</table></div></address></body>
234</html>
Note: See TracBrowser for help on using the repository browser.