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/src/widgets/qtoolbutton.cpp:75 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QToolButton Class</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { 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 Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main 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 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 Class Reference</h1>
|
---|
33 |
|
---|
34 | <p>The QToolButton class provides a quick-access button to
|
---|
35 | commands or options, usually used inside a QToolBar.
|
---|
36 | <a href="#details">More...</a>
|
---|
37 | <p><tt>#include <<a href="qtoolbutton-h.html">qtoolbutton.h</a>></tt>
|
---|
38 | <p>Inherits <a href="qbutton.html">QButton</a>.
|
---|
39 | <p><a href="qtoolbutton-members.html">List of all member functions.</a>
|
---|
40 | <h2>Public Members</h2>
|
---|
41 | <ul>
|
---|
42 | <li class=fn>enum <a href="#TextPosition-enum"><b>TextPosition</b></a> { BesideIcon, BelowIcon, Right = BesideIcon, Under = BelowIcon }</li>
|
---|
43 | <li class=fn><a href="#QToolButton"><b>QToolButton</b></a> ( QWidget * parent, const char * name = 0 )</li>
|
---|
44 | <li class=fn><a href="#QToolButton-2"><b>QToolButton</b></a> ( const QIconSet & iconSet, const QString & textLabel, const QString & grouptext, QObject * receiver, const char * slot, QToolBar * parent, const char * name = 0 )</li>
|
---|
45 | <li class=fn><a href="#QToolButton-3"><b>QToolButton</b></a> ( ArrowType type, QWidget * parent, const char * name = 0 )</li>
|
---|
46 | <li class=fn><a href="#~QToolButton"><b>~QToolButton</b></a> ()</li>
|
---|
47 | <li class=fn>void setOnIconSet ( const QIconSet & ) <em>(obsolete)</em></li>
|
---|
48 | <li class=fn>void setOffIconSet ( const QIconSet & ) <em>(obsolete)</em></li>
|
---|
49 | <li class=fn>void setIconSet ( const QIconSet & set, bool on ) <em>(obsolete)</em></li>
|
---|
50 | <li class=fn>QIconSet onIconSet () const <em>(obsolete)</em></li>
|
---|
51 | <li class=fn>QIconSet offIconSet () const <em>(obsolete)</em></li>
|
---|
52 | <li class=fn>QIconSet iconSet ( bool on ) const <em>(obsolete)</em></li>
|
---|
53 | <li class=fn>virtual void <a href="#setIconSet"><b>setIconSet</b></a> ( const QIconSet & )</li>
|
---|
54 | <li class=fn>QIconSet <a href="#iconSet"><b>iconSet</b></a> () const</li>
|
---|
55 | <li class=fn>bool <a href="#usesBigPixmap"><b>usesBigPixmap</b></a> () const</li>
|
---|
56 | <li class=fn>bool <a href="#usesTextLabel"><b>usesTextLabel</b></a> () const</li>
|
---|
57 | <li class=fn>QString <a href="#textLabel"><b>textLabel</b></a> () const</li>
|
---|
58 | <li class=fn>void <a href="#setPopup"><b>setPopup</b></a> ( QPopupMenu * popup )</li>
|
---|
59 | <li class=fn>QPopupMenu * <a href="#popup"><b>popup</b></a> () const</li>
|
---|
60 | <li class=fn>void <a href="#setPopupDelay"><b>setPopupDelay</b></a> ( int delay )</li>
|
---|
61 | <li class=fn>int <a href="#popupDelay"><b>popupDelay</b></a> () const</li>
|
---|
62 | <li class=fn>void <a href="#openPopup"><b>openPopup</b></a> ()</li>
|
---|
63 | <li class=fn>void <a href="#setAutoRaise"><b>setAutoRaise</b></a> ( bool enable )</li>
|
---|
64 | <li class=fn>bool <a href="#autoRaise"><b>autoRaise</b></a> () const</li>
|
---|
65 | <li class=fn>TextPosition <a href="#textPosition"><b>textPosition</b></a> () const</li>
|
---|
66 | </ul>
|
---|
67 | <h2>Public Slots</h2>
|
---|
68 | <ul>
|
---|
69 | <li class=fn>virtual void <a href="#setUsesBigPixmap"><b>setUsesBigPixmap</b></a> ( bool enable )</li>
|
---|
70 | <li class=fn>virtual void <a href="#setUsesTextLabel"><b>setUsesTextLabel</b></a> ( bool enable )</li>
|
---|
71 | <li class=fn>virtual void <a href="#setTextLabel-2"><b>setTextLabel</b></a> ( const QString & newLabel, bool tipToo )</li>
|
---|
72 | <li class=fn>virtual void <a href="#setToggleButton"><b>setToggleButton</b></a> ( bool enable )</li>
|
---|
73 | <li class=fn>virtual void <a href="#setOn"><b>setOn</b></a> ( bool enable )</li>
|
---|
74 | <li class=fn>void <a href="#toggle"><b>toggle</b></a> ()</li>
|
---|
75 | <li class=fn>void <a href="#setTextLabel"><b>setTextLabel</b></a> ( const QString & )</li>
|
---|
76 | <li class=fn>void <a href="#setTextPosition"><b>setTextPosition</b></a> ( TextPosition pos )</li>
|
---|
77 | </ul>
|
---|
78 | <h2>Properties</h2>
|
---|
79 | <ul>
|
---|
80 | <li class=fn>bool <a href="#autoRaise-prop"><b>autoRaise</b></a> - whether auto-raising is enabled</li>
|
---|
81 | <li class=fn>BackgroundMode <a href="#backgroundMode-prop"><b>backgroundMode</b></a> - the toolbutton's background mode <em>(read only)</em></li>
|
---|
82 | <li class=fn>QIconSet <a href="#iconSet-prop"><b>iconSet</b></a> - the icon set providing the icon shown on the button</li>
|
---|
83 | <li class=fn>QIconSet offIconSet - the icon set that is used when the button is in an "off" state <em>(obsolete)</em></li>
|
---|
84 | <li class=fn>bool <a href="#on-prop"><b>on</b></a> - whether this tool button is on</li>
|
---|
85 | <li class=fn>QIconSet onIconSet - the icon set that is used when the button is in an "on" state <em>(obsolete)</em></li>
|
---|
86 | <li class=fn>QPixmap <a href="#pixmap-prop"><b>pixmap</b></a> - the pixmap of the button <em>(read only)</em></li>
|
---|
87 | <li class=fn>int <a href="#popupDelay-prop"><b>popupDelay</b></a> - the time delay between pressing the button and the appearance of the associated popup menu in milliseconds</li>
|
---|
88 | <li class=fn>QString <a href="#textLabel-prop"><b>textLabel</b></a> - the label of this button</li>
|
---|
89 | <li class=fn>TextPosition <a href="#textPosition-prop"><b>textPosition</b></a> - the position of the text label of this button</li>
|
---|
90 | <li class=fn>bool <a href="#toggleButton-prop"><b>toggleButton</b></a> - whether this tool button is a toggle button</li>
|
---|
91 | <li class=fn>bool <a href="#usesBigPixmap-prop"><b>usesBigPixmap</b></a> - whether this toolbutton uses big pixmaps</li>
|
---|
92 | <li class=fn>bool <a href="#usesTextLabel-prop"><b>usesTextLabel</b></a> - whether the toolbutton displays a text label below the button pixmap</li>
|
---|
93 | </ul>
|
---|
94 | <h2>Protected Members</h2>
|
---|
95 | <ul>
|
---|
96 | <li class=fn>bool <a href="#uses3D"><b>uses3D</b></a> () const</li>
|
---|
97 | </ul>
|
---|
98 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
99 |
|
---|
100 |
|
---|
101 | The QToolButton class provides a quick-access button to
|
---|
102 | commands or options, usually used inside a <a href="qtoolbar.html">QToolBar</a>.
|
---|
103 | <p>
|
---|
104 |
|
---|
105 | <p> A tool button is a special button that provides quick-access to
|
---|
106 | specific commands or options. As opposed to a normal command
|
---|
107 | button, a tool button usually doesn't show a text label, but shows
|
---|
108 | an icon instead. Its classic usage is to select tools, for example
|
---|
109 | the "pen" tool in a drawing program. This would be implemented
|
---|
110 | with a QToolButton as toggle button (see <a href="#setToggleButton">setToggleButton</a>() ).
|
---|
111 | <p> QToolButton supports auto-raising. In auto-raise mode, the button
|
---|
112 | draws a 3D frame only when the mouse points at it. The feature is
|
---|
113 | automatically turned on when a button is used inside a QToolBar.
|
---|
114 | Change it with <a href="#setAutoRaise">setAutoRaise</a>().
|
---|
115 | <p> A tool button's icon is set as <a href="qiconset.html">QIconSet</a>. This makes it possible to
|
---|
116 | specify different pixmaps for the disabled and active state. The
|
---|
117 | disabled pixmap is used when the button's functionality is not
|
---|
118 | available. The active pixmap is displayed when the button is
|
---|
119 | auto-raised because the mouse pointer is hovering over it.
|
---|
120 | <p> The button's look and dimension is adjustable with
|
---|
121 | <a href="#setUsesBigPixmap">setUsesBigPixmap</a>() and <a href="#setUsesTextLabel">setUsesTextLabel</a>(). When used inside a
|
---|
122 | <a href="qtoolbar.html">QToolBar</a> in a <a href="qmainwindow.html">QMainWindow</a>, the button automatically adjusts to
|
---|
123 | QMainWindow's settings (see <a href="qmainwindow.html#setUsesTextLabel">QMainWindow::setUsesTextLabel</a>() and
|
---|
124 | <a href="qmainwindow.html#setUsesBigPixmaps">QMainWindow::setUsesBigPixmaps</a>()). The pixmap set on a QToolButton
|
---|
125 | will be set to 22x22 if it is bigger than this size. If
|
---|
126 | <a href="#usesBigPixmap">usesBigPixmap</a>() is TRUE, then the pixmap will be set to 32x32.
|
---|
127 | <p> A tool button can offer additional choices in a popup menu. The
|
---|
128 | feature is sometimes used with the "Back" button in a web browser.
|
---|
129 | After pressing and holding the button down for a while, a menu
|
---|
130 | pops up showing a list of possible pages to jump to. With
|
---|
131 | QToolButton you can set a popup menu using <a href="#setPopup">setPopup</a>(). The default
|
---|
132 | delay is 600ms; you can adjust it with <a href="#setPopupDelay">setPopupDelay</a>().
|
---|
133 | <p> <center><img src="qdockwindow.png" alt="Toolbar with Toolbuttons \caption A floating"></center> QToolbar with QToolbuttons
|
---|
134 | <p> <p>See also <a href="qpushbutton.html">QPushButton</a>, <a href="qtoolbar.html">QToolBar</a>, <a href="qmainwindow.html">QMainWindow</a>, <a href="guibooks.html#fowler
|
---|
135 | ">GUI Design Handbook: Push Button</a>, and <a href="basic.html">Basic Widgets</a>.
|
---|
136 |
|
---|
137 | <hr><h2>Member Type Documentation</h2>
|
---|
138 | <h3 class=fn><a name="TextPosition-enum"></a>QToolButton::TextPosition</h3>
|
---|
139 |
|
---|
140 | <p> The position of the tool button's textLabel in relation to the
|
---|
141 | tool button's icon.
|
---|
142 | <ul>
|
---|
143 | <li><tt>QToolButton::BesideIcon</tt> - The text appears beside the icon.
|
---|
144 | <li><tt>QToolButton::BelowIcon</tt> - The text appears below the icon.
|
---|
145 | </ul>
|
---|
146 | <hr><h2>Member Function Documentation</h2>
|
---|
147 | <h3 class=fn><a name="QToolButton"></a>QToolButton::QToolButton ( <a href="qwidget.html">QWidget</a> * parent, const char * name = 0 )
|
---|
148 | </h3>
|
---|
149 | Constructs an empty tool button called <em>name</em>, with parent <em>parent</em>.
|
---|
150 |
|
---|
151 | <h3 class=fn><a name="QToolButton-2"></a>QToolButton::QToolButton ( const <a href="qiconset.html">QIconSet</a> & iconSet, const <a href="qstring.html">QString</a> & textLabel, const <a href="qstring.html">QString</a> & grouptext, <a href="qobject.html">QObject</a> * receiver, const char * slot, <a href="qtoolbar.html">QToolBar</a> * parent, const char * name = 0 )
|
---|
152 | </h3>
|
---|
153 | Constructs a tool button called <em>name</em>, that is a child of <em>parent</em> (which must be a <a href="qtoolbar.html">QToolBar</a>).
|
---|
154 | <p> The tool button will display <em>iconSet</em>, with its text label and
|
---|
155 | tool tip set to <em>textLabel</em> and its status bar message set to <em>grouptext</em>. It will be connected to the <em>slot</em> in object <em>receiver</em>.
|
---|
156 |
|
---|
157 | <h3 class=fn><a name="QToolButton-3"></a>QToolButton::QToolButton ( <a href="qt.html#ArrowType-enum">ArrowType</a> type, <a href="qwidget.html">QWidget</a> * parent, const char * name = 0 )
|
---|
158 | </h3>
|
---|
159 | Constructs a tool button as an arrow button. The <a href="qt.html#ArrowType-enum">ArrowType</a> <em>type</em> defines the arrow direction. Possible values are <a href="qt.html#ArrowType-enum">LeftArrow</a>, <a href="qt.html#ArrowType-enum">RightArrow</a>, <a href="qt.html#ArrowType-enum">UpArrow</a> and <a href="qt.html#ArrowType-enum">DownArrow</a>.
|
---|
160 | <p> An arrow button has auto-repeat turned on by default.
|
---|
161 | <p> The <em>parent</em> and <em>name</em> arguments are sent to the <a href="qwidget.html">QWidget</a>
|
---|
162 | constructor.
|
---|
163 |
|
---|
164 | <h3 class=fn><a name="~QToolButton"></a>QToolButton::~QToolButton ()
|
---|
165 | </h3>
|
---|
166 | Destroys the object and frees any allocated resources.
|
---|
167 |
|
---|
168 | <h3 class=fn>bool <a name="autoRaise"></a>QToolButton::autoRaise () const
|
---|
169 | </h3><p>Returns TRUE if auto-raising is enabled; otherwise returns FALSE.
|
---|
170 | See the <a href="qtoolbutton.html#autoRaise-prop">"autoRaise"</a> property for details.
|
---|
171 | <h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="iconSet"></a>QToolButton::iconSet () const
|
---|
172 | </h3><p>Returns the icon set providing the icon shown on the button.
|
---|
173 | See the <a href="qtoolbutton.html#iconSet-prop">"iconSet"</a> property for details.
|
---|
174 | <h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="iconSet-2"></a>QToolButton::iconSet ( bool on ) const
|
---|
175 | </h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
176 | <p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
177 | <p> Since Qt 3.0, <a href="qiconset.html">QIconSet</a> contains both the On and Off icons.
|
---|
178 | <p> For ease of porting, this function ignores the <em>on</em> parameter and
|
---|
179 | returns the <a href="#iconSet-prop">iconSet</a> property. If you relied on the <em>on</em>
|
---|
180 | parameter, you probably want to update your code to use the QIconSet
|
---|
181 | On/Off mechanism.
|
---|
182 |
|
---|
183 | <h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="offIconSet"></a>QToolButton::offIconSet () const
|
---|
184 | </h3><p>Returns the icon set that is used when the button is in an "off" state.
|
---|
185 | See the <a href="qtoolbutton.html#offIconSet-prop">"offIconSet"</a> property for details.
|
---|
186 | <h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="onIconSet"></a>QToolButton::onIconSet () const
|
---|
187 | </h3><p>Returns the icon set that is used when the button is in an "on" state.
|
---|
188 | See the <a href="qtoolbutton.html#onIconSet-prop">"onIconSet"</a> property for details.
|
---|
189 | <h3 class=fn>void <a name="openPopup"></a>QToolButton::openPopup ()
|
---|
190 | </h3>
|
---|
191 | Opens (pops up) the associated popup menu. If there is no such
|
---|
192 | menu, this function does nothing. This function does not return
|
---|
193 | until the popup menu has been closed by the user.
|
---|
194 |
|
---|
195 | <h3 class=fn><a href="qpopupmenu.html">QPopupMenu</a> * <a name="popup"></a>QToolButton::popup () const
|
---|
196 | </h3>
|
---|
197 | Returns the associated popup menu, or 0 if no popup menu has been
|
---|
198 | defined.
|
---|
199 | <p> <p>See also <a href="#setPopup">setPopup</a>().
|
---|
200 |
|
---|
201 | <h3 class=fn>int <a name="popupDelay"></a>QToolButton::popupDelay () const
|
---|
202 | </h3><p>Returns the time delay between pressing the button and the appearance of the associated popup menu in milliseconds.
|
---|
203 | See the <a href="qtoolbutton.html#popupDelay-prop">"popupDelay"</a> property for details.
|
---|
204 | <h3 class=fn>void <a name="setAutoRaise"></a>QToolButton::setAutoRaise ( bool enable )
|
---|
205 | </h3><p>Sets whether auto-raising is enabled to <em>enable</em>.
|
---|
206 | See the <a href="qtoolbutton.html#autoRaise-prop">"autoRaise"</a> property for details.
|
---|
207 | <h3 class=fn>void <a name="setIconSet"></a>QToolButton::setIconSet ( const <a href="qiconset.html">QIconSet</a> & )<tt> [virtual]</tt>
|
---|
208 | </h3><p>Sets the icon set providing the icon shown on the button.
|
---|
209 | See the <a href="qtoolbutton.html#iconSet-prop">"iconSet"</a> property for details.
|
---|
210 | <h3 class=fn>void <a name="setIconSet-2"></a>QToolButton::setIconSet ( const <a href="qiconset.html">QIconSet</a> & set, bool on )
|
---|
211 | </h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
212 | <p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
213 | <p> Since Qt 3.0, <a href="qiconset.html">QIconSet</a> contains both the On and Off icons.
|
---|
214 | <p> For ease of porting, this function ignores the <em>on</em> parameter and
|
---|
215 | sets the <a href="#iconSet-prop">iconSet</a> property. If you relied on the <em>on</em> parameter,
|
---|
216 | you probably want to update your code to use the QIconSet On/Off
|
---|
217 | mechanism.
|
---|
218 | <p> <p>See also <a href="#iconSet-prop">iconSet</a> and <a href="qiconset.html#State-enum">QIconSet::State</a>.
|
---|
219 |
|
---|
220 | <h3 class=fn>void <a name="setOffIconSet"></a>QToolButton::setOffIconSet ( const <a href="qiconset.html">QIconSet</a> & )
|
---|
221 | </h3><p>Sets the icon set that is used when the button is in an "off" state.
|
---|
222 | See the <a href="qtoolbutton.html#offIconSet-prop">"offIconSet"</a> property for details.
|
---|
223 | <h3 class=fn>void <a name="setOn"></a>QToolButton::setOn ( bool enable )<tt> [virtual slot]</tt>
|
---|
224 | </h3><p>Sets whether this tool button is on to <em>enable</em>.
|
---|
225 | See the <a href="qtoolbutton.html#on-prop">"on"</a> property for details.
|
---|
226 | <h3 class=fn>void <a name="setOnIconSet"></a>QToolButton::setOnIconSet ( const <a href="qiconset.html">QIconSet</a> & )
|
---|
227 | </h3><p>Sets the icon set that is used when the button is in an "on" state.
|
---|
228 | See the <a href="qtoolbutton.html#onIconSet-prop">"onIconSet"</a> property for details.
|
---|
229 | <h3 class=fn>void <a name="setPopup"></a>QToolButton::setPopup ( <a href="qpopupmenu.html">QPopupMenu</a> * popup )
|
---|
230 | </h3>
|
---|
231 | Associates the popup menu <em>popup</em> with this tool button.
|
---|
232 | <p> The popup will be shown each time the tool button has been pressed
|
---|
233 | down for a certain amount of time. A typical application example
|
---|
234 | is the "back" button in some web browsers's tool bars. If the user
|
---|
235 | clicks it, the browser simply browses back to the previous page.
|
---|
236 | If the user presses and holds the button down for a while, the
|
---|
237 | tool button shows a menu containing the current history list.
|
---|
238 | <p> Ownership of the popup menu is not transferred to the tool button.
|
---|
239 | <p> <p>See also <a href="#popup">popup</a>().
|
---|
240 |
|
---|
241 | <h3 class=fn>void <a name="setPopupDelay"></a>QToolButton::setPopupDelay ( int delay )
|
---|
242 | </h3><p>Sets the time delay between pressing the button and the appearance of the associated popup menu in milliseconds to <em>delay</em>.
|
---|
243 | See the <a href="qtoolbutton.html#popupDelay-prop">"popupDelay"</a> property for details.
|
---|
244 | <h3 class=fn>void <a name="setTextLabel"></a>QToolButton::setTextLabel ( const <a href="qstring.html">QString</a> & )<tt> [slot]</tt>
|
---|
245 | </h3><p>Sets the label of this button.
|
---|
246 | See the <a href="qtoolbutton.html#textLabel-prop">"textLabel"</a> property for details.
|
---|
247 | <h3 class=fn>void <a name="setTextLabel-2"></a>QToolButton::setTextLabel ( const <a href="qstring.html">QString</a> & newLabel, bool tipToo )<tt> [virtual slot]</tt>
|
---|
248 | </h3>
|
---|
249 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
250 | <p> Sets the label of this button to <em>newLabel</em> and automatically
|
---|
251 | sets it as a tool tip if <em>tipToo</em> is TRUE.
|
---|
252 |
|
---|
253 | <h3 class=fn>void <a name="setTextPosition"></a>QToolButton::setTextPosition ( <a href="qtoolbutton.html#TextPosition-enum">TextPosition</a> pos )<tt> [slot]</tt>
|
---|
254 | </h3><p>Sets the position of the text label of this button to <em>pos</em>.
|
---|
255 | See the <a href="qtoolbutton.html#textPosition-prop">"textPosition"</a> property for details.
|
---|
256 | <h3 class=fn>void <a name="setToggleButton"></a>QToolButton::setToggleButton ( bool enable )<tt> [virtual slot]</tt>
|
---|
257 | </h3><p>Sets whether this tool button is a toggle button to <em>enable</em>.
|
---|
258 | See the <a href="qtoolbutton.html#toggleButton-prop">"toggleButton"</a> property for details.
|
---|
259 | <h3 class=fn>void <a name="setUsesBigPixmap"></a>QToolButton::setUsesBigPixmap ( bool enable )<tt> [virtual slot]</tt>
|
---|
260 | </h3><p>Sets whether this toolbutton uses big pixmaps to <em>enable</em>.
|
---|
261 | See the <a href="qtoolbutton.html#usesBigPixmap-prop">"usesBigPixmap"</a> property for details.
|
---|
262 | <h3 class=fn>void <a name="setUsesTextLabel"></a>QToolButton::setUsesTextLabel ( bool enable )<tt> [virtual slot]</tt>
|
---|
263 | </h3><p>Sets whether the toolbutton displays a text label below the button pixmap to <em>enable</em>.
|
---|
264 | See the <a href="qtoolbutton.html#usesTextLabel-prop">"usesTextLabel"</a> property for details.
|
---|
265 | <h3 class=fn><a href="qstring.html">QString</a> <a name="textLabel"></a>QToolButton::textLabel () const
|
---|
266 | </h3><p>Returns the label of this button.
|
---|
267 | See the <a href="qtoolbutton.html#textLabel-prop">"textLabel"</a> property for details.
|
---|
268 | <h3 class=fn><a href="qtoolbutton.html#TextPosition-enum">TextPosition</a> <a name="textPosition"></a>QToolButton::textPosition () const
|
---|
269 | </h3><p>Returns the position of the text label of this button.
|
---|
270 | See the <a href="qtoolbutton.html#textPosition-prop">"textPosition"</a> property for details.
|
---|
271 | <h3 class=fn>void <a name="toggle"></a>QToolButton::toggle ()<tt> [slot]</tt>
|
---|
272 | </h3>
|
---|
273 | Toggles the state of this tool button.
|
---|
274 | <p> This function has no effect on <a href="qbutton.html#isToggleButton">non-toggling
|
---|
275 | buttons.</a>
|
---|
276 | <p> <p>See also <a href="#toggleButton-prop">toggleButton</a> and <a href="qbutton.html#toggled">toggled</a>().
|
---|
277 |
|
---|
278 | <h3 class=fn>bool <a name="uses3D"></a>QToolButton::uses3D () const<tt> [protected]</tt>
|
---|
279 | </h3>
|
---|
280 | Returns TRUE if this button should be drawn using raised edges;
|
---|
281 | otherwise returns FALSE.
|
---|
282 | <p> <p>See also <a href="qbutton.html#drawButton">drawButton</a>().
|
---|
283 |
|
---|
284 | <h3 class=fn>bool <a name="usesBigPixmap"></a>QToolButton::usesBigPixmap () const
|
---|
285 | </h3><p>Returns TRUE if this toolbutton uses big pixmaps; otherwise returns FALSE.
|
---|
286 | See the <a href="qtoolbutton.html#usesBigPixmap-prop">"usesBigPixmap"</a> property for details.
|
---|
287 | <h3 class=fn>bool <a name="usesTextLabel"></a>QToolButton::usesTextLabel () const
|
---|
288 | </h3><p>Returns TRUE if the toolbutton displays a text label below the button pixmap; otherwise returns FALSE.
|
---|
289 | See the <a href="qtoolbutton.html#usesTextLabel-prop">"usesTextLabel"</a> property for details.
|
---|
290 | <hr><h2>Property Documentation</h2>
|
---|
291 | <h3 class=fn>bool <a name="autoRaise-prop"></a>autoRaise</h3>
|
---|
292 | <p>This property holds whether auto-raising is enabled.
|
---|
293 | <p>The default is disabled (i.e. FALSE).
|
---|
294 |
|
---|
295 | <p>Set this property's value with <a href="#setAutoRaise">setAutoRaise</a>() and get this property's value with <a href="#autoRaise">autoRaise</a>().
|
---|
296 | <h3 class=fn><a href="qt.html#BackgroundMode-enum">BackgroundMode</a> <a name="backgroundMode-prop"></a>backgroundMode</h3>
|
---|
297 | <p>This property holds the toolbutton's background mode.
|
---|
298 | <p>Get this property with <a href="qwidget.html#backgroundMode">backgroundMode</a>().
|
---|
299 | <p> <p>See also <a href="qwidget.html#backgroundMode-prop">QWidget::backgroundMode</a>.
|
---|
300 |
|
---|
301 | <p><h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="iconSet-prop"></a>iconSet</h3>
|
---|
302 | <p>This property holds the icon set providing the icon shown on the button.
|
---|
303 | <p>Setting this property sets <a href="#pixmap-prop">QToolButton::pixmap</a> to a null
|
---|
304 | pixmap. There is no default iconset.
|
---|
305 | <p> <p>See also <a href="#pixmap-prop">pixmap</a>, <a href="#toggleButton-prop">toggleButton</a>, and <a href="#on-prop">on</a>.
|
---|
306 |
|
---|
307 | <p>Set this property's value with <a href="#setIconSet">setIconSet</a>() and get this property's value with <a href="#iconSet">iconSet</a>().
|
---|
308 | <h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="offIconSet-prop"></a>offIconSet</h3>
|
---|
309 | <p>This property holds the icon set that is used when the button is in an "off" state.
|
---|
310 | <p><b>This property is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
311 | <p> Since Qt 3.0, <a href="qiconset.html">QIconSet</a> contains both the On and Off icons. There is
|
---|
312 | now an <a href="#iconSet-prop">QToolButton::iconSet</a> property that replaces both <a href="#onIconSet-prop">QToolButton::onIconSet</a> and <a href="#offIconSet-prop">QToolButton::offIconSet</a>.
|
---|
313 | <p> For ease of porting, this property is a synonym for <a href="#iconSet-prop">QToolButton::iconSet</a>. You probably want to go over your application
|
---|
314 | code and use the QIconSet On/Off mechanism.
|
---|
315 | <p> <p>See also <a href="#iconSet-prop">iconSet</a> and <a href="qiconset.html#State-enum">QIconSet::State</a>.
|
---|
316 |
|
---|
317 | <p>Set this property's value with <a href="#setOffIconSet">setOffIconSet</a>() and get this property's value with <a href="#offIconSet">offIconSet</a>().
|
---|
318 | <h3 class=fn>bool <a name="on-prop"></a>on</h3>
|
---|
319 | <p>This property holds whether this tool button is on.
|
---|
320 | <p>This property has no effect on <a href="qbutton.html#isToggleButton">non-toggling
|
---|
321 | buttons.</a> The default is FALSE (i.e. off).
|
---|
322 | <p> <p>See also <a href="#toggleButton-prop">toggleButton</a> and <a href="#toggle">toggle</a>().
|
---|
323 |
|
---|
324 | <p>Set this property's value with <a href="#setOn">setOn</a>().
|
---|
325 | <h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="onIconSet-prop"></a>onIconSet</h3>
|
---|
326 | <p>This property holds the icon set that is used when the button is in an "on" state.
|
---|
327 | <p><b>This property is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
328 | <p> Since Qt 3.0, <a href="qiconset.html">QIconSet</a> contains both the On and Off icons. There is
|
---|
329 | now an <a href="#iconSet-prop">QToolButton::iconSet</a> property that replaces both <a href="#onIconSet-prop">QToolButton::onIconSet</a> and <a href="#offIconSet-prop">QToolButton::offIconSet</a>.
|
---|
330 | <p> For ease of porting, this property is a synonym for <a href="#iconSet-prop">QToolButton::iconSet</a>. You probably want to go over your application
|
---|
331 | code and use the QIconSet On/Off mechanism.
|
---|
332 | <p> <p>See also <a href="#iconSet-prop">iconSet</a> and <a href="qiconset.html#State-enum">QIconSet::State</a>.
|
---|
333 |
|
---|
334 | <p>Set this property's value with <a href="#setOnIconSet">setOnIconSet</a>() and get this property's value with <a href="#onIconSet">onIconSet</a>().
|
---|
335 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="pixmap-prop"></a>pixmap</h3> <p>This property holds the pixmap of the button.
|
---|
336 | <p>The pixmap property has no meaning for tool buttons. Use the
|
---|
337 | iconSet property instead.
|
---|
338 |
|
---|
339 | <p><h3 class=fn>int <a name="popupDelay-prop"></a>popupDelay</h3>
|
---|
340 | <p>This property holds the time delay between pressing the button and the appearance of the associated popup menu in milliseconds.
|
---|
341 | <p>Usually this is around half a second. A value of 0 draws the down
|
---|
342 | arrow button to the side of the button which can be used to open
|
---|
343 | up the popup menu.
|
---|
344 | <p> <p>See also <a href="#setPopup">setPopup</a>().
|
---|
345 |
|
---|
346 | <p>Set this property's value with <a href="#setPopupDelay">setPopupDelay</a>() and get this property's value with <a href="#popupDelay">popupDelay</a>().
|
---|
347 | <h3 class=fn><a href="qstring.html">QString</a> <a name="textLabel-prop"></a>textLabel</h3>
|
---|
348 | <p>This property holds the label of this button.
|
---|
349 | <p>Setting this property automatically sets the text as a tool tip
|
---|
350 | too. There is no default text.
|
---|
351 |
|
---|
352 | <p>Set this property's value with <a href="#setTextLabel">setTextLabel</a>() and get this property's value with <a href="#textLabel">textLabel</a>().
|
---|
353 | <h3 class=fn><a href="qtoolbutton.html#TextPosition-enum">TextPosition</a> <a name="textPosition-prop"></a>textPosition</h3>
|
---|
354 | <p>This property holds the position of the text label of this button.
|
---|
355 | <p>
|
---|
356 | <p>Set this property's value with <a href="#setTextPosition">setTextPosition</a>() and get this property's value with <a href="#textPosition">textPosition</a>().
|
---|
357 | <h3 class=fn>bool <a name="toggleButton-prop"></a>toggleButton</h3>
|
---|
358 | <p>This property holds whether this tool button is a toggle button.
|
---|
359 | <p>Toggle buttons have an on/off state similar to <a href="qcheckbox.html">check boxes.</a> A tool button is not a toggle button by
|
---|
360 | default.
|
---|
361 | <p> <p>See also <a href="#on-prop">on</a> and <a href="#toggle">toggle</a>().
|
---|
362 |
|
---|
363 | <p>Set this property's value with <a href="#setToggleButton">setToggleButton</a>().
|
---|
364 | <h3 class=fn>bool <a name="usesBigPixmap-prop"></a>usesBigPixmap</h3>
|
---|
365 | <p>This property holds whether this toolbutton uses big pixmaps.
|
---|
366 | <p>QToolButton automatically connects this property to the relevant
|
---|
367 | signal in the <a href="qmainwindow.html">QMainWindow</a> in which it resides. We strongly
|
---|
368 | recommend that you use <a href="qmainwindow.html#setUsesBigPixmaps">QMainWindow::setUsesBigPixmaps</a>() instead.
|
---|
369 | <p> This property's default is TRUE.
|
---|
370 | <p> <b>Warning:</b> If you set some buttons (in a QMainWindow) to have big
|
---|
371 | pixmaps and others to have small pixmaps, QMainWindow may not get
|
---|
372 | the geometry right.
|
---|
373 |
|
---|
374 | <p>Set this property's value with <a href="#setUsesBigPixmap">setUsesBigPixmap</a>() and get this property's value with <a href="#usesBigPixmap">usesBigPixmap</a>().
|
---|
375 | <h3 class=fn>bool <a name="usesTextLabel-prop"></a>usesTextLabel</h3>
|
---|
376 | <p>This property holds whether the toolbutton displays a text label below the button pixmap.
|
---|
377 | <p>The default is FALSE.
|
---|
378 | <p> QToolButton automatically connects this slot to the relevant
|
---|
379 | signal in the <a href="qmainwindow.html">QMainWindow</a> in which is resides.
|
---|
380 |
|
---|
381 | <p>Set this property's value with <a href="#setUsesTextLabel">setUsesTextLabel</a>() and get this property's value with <a href="#usesTextLabel">usesTextLabel</a>().
|
---|
382 | <!-- eof -->
|
---|
383 | <hr><p>
|
---|
384 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
385 | Copyright © 1995-2007
|
---|
386 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
387 | <table width=100% cellspacing=0 border=0><tr>
|
---|
388 | <td>Copyright © 2007
|
---|
389 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
390 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
391 | </table></div></address></body>
|
---|
392 | </html>
|
---|