Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1688

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/widgets/qpushbutton.cpp:56 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QPushButton Class</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QPushButton Class Reference</h1>

<p>The QPushButton widget provides a command button.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qpushbutton-h.html">qpushbutton.h</a>&gt;</tt>
<p>Inherits <a href="qbutton.html">QButton</a>.
<p><a href="qpushbutton-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn><a href="#QPushButton"><b>QPushButton</b></a> ( QWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li>
<li><div class=fn><a href="#QPushButton-2"><b>QPushButton</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, QWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li>
<li><div class=fn><a href="#QPushButton-3"><b>QPushButton</b></a> ( const&nbsp;QIconSet&nbsp;&amp;&nbsp;icon, const&nbsp;QString&nbsp;&amp;&nbsp;text, QWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li>
<li><div class=fn><a href="#~QPushButton"><b>~QPushButton</b></a> ()</div></li>
<li><div class=fn>void <a href="#setToggleButton"><b>setToggleButton</b></a> ( bool )</div></li>
<li><div class=fn>bool <a href="#autoDefault"><b>autoDefault</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setAutoDefault"><b>setAutoDefault</b></a> ( bool&nbsp;autoDef )</div></li>
<li><div class=fn>bool <a href="#isDefault"><b>isDefault</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setDefault"><b>setDefault</b></a> ( bool&nbsp;def )</div></li>
<li><div class=fn>virtual void setIsMenuButton ( bool&nbsp;enable ) &nbsp;<em>(obsolete)</em></div></li>
<li><div class=fn>bool isMenuButton () const &nbsp;<em>(obsolete)</em></div></li>
<li><div class=fn>void <a href="#setPopup"><b>setPopup</b></a> ( QPopupMenu&nbsp;*&nbsp;popup )</div></li>
<li><div class=fn>QPopupMenu * <a href="#popup"><b>popup</b></a> () const</div></li>
<li><div class=fn>void <a href="#setIconSet"><b>setIconSet</b></a> ( const QIconSet &amp; )</div></li>
<li><div class=fn>QIconSet * <a href="#iconSet"><b>iconSet</b></a> () const</div></li>
<li><div class=fn>void <a href="#setFlat"><b>setFlat</b></a> ( bool )</div></li>
<li><div class=fn>bool <a href="#isFlat"><b>isFlat</b></a> () const</div></li>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class=fn>virtual void <a href="#setOn"><b>setOn</b></a> ( bool )</div></li>
</ul>
<h2>Important Inherited Members</h2>
<ul>
<li><div class=fn>QString <a href="#text"><b>text</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setText"><b>setText</b></a> ( const QString &amp; )</div></li>
<li><div class=fn>const QPixmap * <a href="#pixmap"><b>pixmap</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setPixmap"><b>setPixmap</b></a> ( const QPixmap &amp; )</div></li>
<li><div class=fn>QKeySequence <a href="#accel"><b>accel</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setAccel"><b>setAccel</b></a> ( const QKeySequence &amp; )</div></li>
<li><div class=fn>bool <a href="#isToggleButton"><b>isToggleButton</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setDown"><b>setDown</b></a> ( bool )</div></li>
<li><div class=fn>bool <a href="#isDown"><b>isDown</b></a> () const</div></li>
<li><div class=fn>bool <a href="#isOn"><b>isOn</b></a> () const</div></li>
<li><div class=fn>ToggleState <a href="#state"><b>state</b></a> () const</div></li>
<li><div class=fn>bool <a href="#autoRepeat"><b>autoRepeat</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setAutoRepeat"><b>setAutoRepeat</b></a> ( bool )</div></li>
<li><div class=fn>bool <a href="#isExclusiveToggle"><b>isExclusiveToggle</b></a> () const</div></li>
<li><div class=fn>QButtonGroup * <a href="#group"><b>group</b></a> () const</div></li>
<li><div class=fn>void <a href="#toggle"><b>toggle</b></a> ()</div></li>
<li><div class=fn>void <a href="#pressed"><b>pressed</b></a> ()</div></li>
<li><div class=fn>void <a href="#released"><b>released</b></a> ()</div></li>
<li><div class=fn>void <a href="#clicked"><b>clicked</b></a> ()</div></li>
<li><div class=fn>void <a href="#toggled"><b>toggled</b></a> ( bool&nbsp;on )</div></li>
<li><div class=fn>void <a href="#stateChanged"><b>stateChanged</b></a> ( int&nbsp;state )</div></li>
</ul>
<h2>Properties</h2>
<ul>
<li><div class=fn>bool <a href="#autoDefault-prop"><b>autoDefault</b></a>&nbsp;- whether the push button is the auto default button</div></li>
<li><div class=fn>bool <a href="#autoMask-prop"><b>autoMask</b></a>&nbsp;- whether the button is automatically masked &nbsp;<em>(read only)</em></div></li>
<li><div class=fn>bool <a href="#default-prop"><b>default</b></a>&nbsp;- whether the push button is the default button</div></li>
<li><div class=fn>bool <a href="#flat-prop"><b>flat</b></a>&nbsp;- whether the border is disabled</div></li>
<li><div class=fn>QIconSet <a href="#iconSet-prop"><b>iconSet</b></a>&nbsp;- the icon set on the push button</div></li>
<li><div class=fn>bool menuButton&nbsp;- whether the push button has a menu button on it &nbsp;<em>(read only)</em> &nbsp;<em>(obsolete)</em></div></li>
<li><div class=fn>bool <a href="#on-prop"><b>on</b></a>&nbsp;- whether the push button is toggled</div></li>
<li><div class=fn>bool <a href="#toggleButton-prop"><b>toggleButton</b></a>&nbsp;- whether the button is a toggle button</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The QPushButton widget provides a command button.
<p> 

<p> The push button, or command button, is perhaps the most commonly
used widget in any graphical user interface. Push (click) a button
to command the computer to perform some action, or to answer a
question. Typical buttons are OK, Apply, Cancel, Close, Yes, No and
Help.
<p> A command button is rectangular and typically displays a text label
describing its action. An underscored character in the label
(signified by preceding it with an ampersand in the text) indicates
an accelerator key, e.g.
<pre>
    QPushButton *pb = new QPushButton( "&amp;Download", this );
  </pre>
 
In this example the accelerator is <em>Ctrl+D</em>, and the label text
will be displayed as <b><u>D</u>ownload</b>.
<p> Push buttons can display a textual label or a pixmap, and
optionally a small icon. These can be set using the constructors
and changed later using <a href="qbutton.html#setText">setText</a>(), <a href="qbutton.html#setPixmap">setPixmap</a>() and <a href="#setIconSet">setIconSet</a>(). If
the button is disabled the appearance of the text or pixmap and
iconset will be manipulated with respect to the GUI style to make
the button look "disabled".
<p> A push button emits the signal <a href="qbutton.html#clicked">clicked</a>() when it is activated
by the mouse, the Spacebar or by a keyboard accelerator.
Connect to this signal to perform the button's action. Push buttons
also provide less commonly used signals, for example, <a href="qbutton.html#pressed">pressed</a>()
and <a href="qbutton.html#released">released</a>().
<p> Command buttons in dialogs are by default auto-default buttons,
i.e. they become the default push button automatically when they
receive the keyboard input focus. A default button is a push
button that is activated when the user hits the Enter or Return key
in a dialog. You can change this with <a href="#setAutoDefault">setAutoDefault</a>(). Note that
auto-default buttons reserve a little extra space which is necessary
to draw a default-button indicator. If you do not want this space
around your buttons, call setAutoDefault(FALSE).
<p> Being so central, the button widget has grown to accommodate a great many
variations in the past decade. The Microsoft style guide now
shows about ten different states of Windows push buttons and the
text implies that there are dozens more when all the combinations of
features are taken into consideration.
<p> The most important modes or states are:
<ul>
<li> Available or not (grayed out, disabled).
<li> Standard push button, toggling push button or menu button.
<li> On or off (only for toggling push buttons).
<li> Default or normal.  The default button in a dialog can
generally be "clicked" using the Enter or Return key.
<li> Auto-repeat or not.
<li> Pressed down or not.
</ul>
<p> As a general rule, use a push button when the application or dialog
window performs an action when the user clicks on it (such as Apply,
Cancel, Close and Help) <em>and</em> when the widget is supposed to have
a wide, rectangular shape with a text label.  Small, typically
square buttons that change the state of the window rather than
performing an action (such as the buttons in the top-right
corner of the <a href="qfiledialog.html">QFileDialog</a>) are not command buttons, but tool
buttons. Qt provides a special class (<a href="qtoolbutton.html">QToolButton</a>) for these buttons.
<p> If you need toggle behavior (see <a href="#setToggleButton">setToggleButton</a>()) or a button
that auto-repeats the activation signal when being pushed down like
the arrows in a scroll bar (see <a href="qbutton.html#setAutoRepeat">setAutoRepeat</a>()), a command button is
probably not what you want. When in doubt, use a tool button.
<p> A variation of a command button is a menu button. These provide not
just one command, but several, since when they are clicked they pop
up a menu of options. Use the method <a href="#setPopup">setPopup</a>() to associate a popup
menu with a push button.
<p> Other classes of buttons are option buttons (see <a href="qradiobutton.html">QRadioButton</a>) and
check boxes (see <a href="qcheckbox.html">QCheckBox</a>).
<p> <img src="qpushbt-m.png"> <img src="qpushbt-w.png">
<p> In Qt, the <a href="qbutton.html">QButton</a> base class provides most of the modes and other
API, and QPushButton provides GUI logic.  See QButton for more
information about the API.
<p> 
<p> <p>See also <a href="qtoolbutton.html">QToolButton</a>, <a href="qradiobutton.html">QRadioButton</a>, <a href="qcheckbox.html">QCheckBox</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Push Button</a> and <a href="basic.html">Basic Widgets</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QPushButton"></a>QPushButton::QPushButton ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a push button with no text.
<p> The <em>parent</em> and <em>name</em> arguments are sent to the <a href="qwidget.html">QWidget</a> constructor.

<h3 class=fn><a name="QPushButton-2"></a>QPushButton::QPushButton ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a push button called <em>name</em> with the parent <em>parent</em>
and the text <em>text</em>.

<h3 class=fn><a name="QPushButton-3"></a>QPushButton::QPushButton ( const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;icon, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a push button with an <em>icon</em> and a <em>text</em>.
<p> Note that you can also pass a <a href="qpixmap.html">QPixmap</a> object as an icon (thanks to
the implicit type conversion provided by C++).
<p> The <em>parent</em> and <em>name</em> arguments are sent to the <a href="qwidget.html">QWidget</a> constructor.

<h3 class=fn><a name="~QPushButton"></a>QPushButton::~QPushButton ()
</h3>
Destroys the push button

<h3 class=fn><a href="qkeysequence.html">QKeySequence</a> <a name="accel"></a>QButton::accel () const
</h3><p>Returns the accelerator associated with the button.
See the <a href="qbutton.html#accel-prop">"accel"</a> property for details.
<h3 class=fn>bool <a name="autoDefault"></a>QPushButton::autoDefault () const
</h3><p>Returns TRUE if the push button is the auto default button; otherwise returns FALSE.
See the <a href="qpushbutton.html#autoDefault-prop">"autoDefault"</a> property for details.
<h3 class=fn>bool <a name="autoRepeat"></a>QButton::autoRepeat () const
</h3><p>Returns TRUE if autoRepeat is enabled; otherwise returns FALSE.
See the <a href="qbutton.html#autoRepeat-prop">"autoRepeat"</a> property for details.
<h3 class=fn>void <a name="clicked"></a>QButton::clicked ()<tt> [signal]</tt>
</h3>

<p> This signal is emitted when the button is activated (i.e. first pressed
down and then released when the mouse cursor is inside the button), when
the accelerator key is typed or when <a href="qbutton.html#animateClick">animateClick</a>() is called.
<p> The <a href="qbuttongroup.html#clicked">QButtonGroup::clicked</a>() signal does the same job, if you want to
connect several buttons to the same slot.
<p> <p>See also <a href="qbutton.html#pressed">pressed</a>(), <a href="qbutton.html#released">released</a>() and <a href="qbutton.html#toggled">toggled</a>().

<p>Examples: <a href="simple-qfont-demo-walkthrough.html#x2387">fonts/simple-qfont-demo/viewer.cpp</a>, <a href="listbox-example.html#x1267">listbox/listbox.cpp</a>, <a href="clientserver-example.html#x1062">network/clientserver/client/client.cpp</a>, <a href="ftpclient-example.html#x1002">network/ftpclient/ftpmainwindow.cpp</a>, <a href="richtext-example.html#x593">richtext/richtext.cpp</a>, <a href="t2.html#x2103">t2/main.cpp</a> and <a href="t4.html#x2119">t4/main.cpp</a>.
<h3 class=fn><a href="qbuttongroup.html">QButtonGroup</a>&nbsp;* <a name="group"></a>QButton::group () const
</h3> Returns a pointer to the group of which this button is a member.
<p> If the button is not a member of any <a href="qbuttongroup.html">QButtonGroup</a>, this function
returns 0.
<p> <p>See also <a href="qbuttongroup.html">QButtonGroup</a>.

<h3 class=fn><a href="qiconset.html">QIconSet</a>&nbsp;* <a name="iconSet"></a>QPushButton::iconSet () const
</h3><p>Returns the icon set on the push button.
See the <a href="qpushbutton.html#iconSet-prop">"iconSet"</a> property for details.
<h3 class=fn>bool <a name="isDefault"></a>QPushButton::isDefault () const
</h3><p>Returns TRUE if the push button is the default button; otherwise returns FALSE.
See the <a href="qpushbutton.html#default-prop">"default"</a> property for details.
<h3 class=fn>bool <a name="isDown"></a>QButton::isDown () const
</h3><p>Returns TRUE if the button is pressed; otherwise returns FALSE.
See the <a href="qbutton.html#down-prop">"down"</a> property for details.
<h3 class=fn>bool <a name="isExclusiveToggle"></a>QButton::isExclusiveToggle () const
</h3><p>Returns TRUE if the button is an exclusive toggle; otherwise returns FALSE.
See the <a href="qbutton.html#exclusiveToggle-prop">"exclusiveToggle"</a> property for details.
<h3 class=fn>bool <a name="isFlat"></a>QPushButton::isFlat () const
</h3><p>Returns TRUE if the border is disabled; otherwise returns FALSE.
See the <a href="qpushbutton.html#flat-prop">"flat"</a> property for details.
<h3 class=fn>bool <a name="isMenuButton"></a>QPushButton::isMenuButton () const
</h3><p>Returns TRUE if the push button has a menu button on it; otherwise returns FALSE.
See the <a href="qpushbutton.html#menuButton-prop">"menuButton"</a> property for details.
<h3 class=fn>bool <a name="isOn"></a>QButton::isOn () const
</h3><p>Returns TRUE if the button is toggled; otherwise returns FALSE.
See the <a href="qbutton.html#on-prop">"on"</a> property for details.
<h3 class=fn>bool <a name="isToggleButton"></a>QButton::isToggleButton () const
</h3><p>Returns TRUE if the button is a toggle button; otherwise returns FALSE.
See the <a href="qbutton.html#toggleButton-prop">"toggleButton"</a> property for details.
<h3 class=fn>const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;* <a name="pixmap"></a>QButton::pixmap () const
</h3><p>Returns the pixmap shown on the button.
See the <a href="qbutton.html#pixmap-prop">"pixmap"</a> property for details.
<h3 class=fn><a href="qpopupmenu.html">QPopupMenu</a>&nbsp;* <a name="popup"></a>QPushButton::popup () const
</h3>
Returns the button's associated popup menu or 0 if no popup menu has
been defined.
<p> <p>See also <a href="#setPopup">setPopup</a>().

<h3 class=fn>void <a name="pressed"></a>QButton::pressed ()<tt> [signal]</tt>
</h3>

This signal is emitted when the button is pressed down.
<p> <p>See also <a href="qbutton.html#released">released</a>() and <a href="qbutton.html#clicked">clicked</a>().

<p>Examples: <a href="httpd-example.html#x989">network/httpd/httpd.cpp</a> and <a href="popup-example.html#x880">popup/popup.cpp</a>.
<h3 class=fn>void <a name="released"></a>QButton::released ()<tt> [signal]</tt>
</h3>

This signal is emitted when the button is released.
<p> <p>See also <a href="qbutton.html#pressed">pressed</a>(), <a href="qbutton.html#clicked">clicked</a>() and <a href="qbutton.html#toggled">toggled</a>().

<h3 class=fn>void <a name="setAccel"></a>QButton::setAccel ( const&nbsp;<a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp; )<tt> [virtual]</tt>
</h3><p>Sets the accelerator associated with the button.
See the <a href="qbutton.html#accel-prop">"accel"</a> property for details.
<h3 class=fn>void <a name="setAutoDefault"></a>QPushButton::setAutoDefault ( bool&nbsp;autoDef )<tt> [virtual]</tt>
</h3><p>Sets whether the push button is the auto default button to <em>autoDef</em>.
See the <a href="qpushbutton.html#autoDefault-prop">"autoDefault"</a> property for details.
<h3 class=fn>void <a name="setAutoRepeat"></a>QButton::setAutoRepeat ( bool )<tt> [virtual]</tt>
</h3><p>Sets whether autoRepeat is enabled.
See the <a href="qbutton.html#autoRepeat-prop">"autoRepeat"</a> property for details.
<h3 class=fn>void <a name="setDefault"></a>QPushButton::setDefault ( bool&nbsp;def )<tt> [virtual]</tt>
</h3><p>Sets whether the push button is the default button to <em>def</em>.
See the <a href="qpushbutton.html#default-prop">"default"</a> property for details.
<h3 class=fn>void <a name="setDown"></a>QButton::setDown ( bool )<tt> [virtual]</tt>
</h3><p>Sets whether the button is pressed.
See the <a href="qbutton.html#down-prop">"down"</a> property for details.
<h3 class=fn>void <a name="setFlat"></a>QPushButton::setFlat ( bool )
</h3><p>Sets whether the border is disabled.
See the <a href="qpushbutton.html#flat-prop">"flat"</a> property for details.
<h3 class=fn>void <a name="setIconSet"></a>QPushButton::setIconSet ( const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp; )
</h3><p>Sets the icon set on the push button.
See the <a href="qpushbutton.html#iconSet-prop">"iconSet"</a> property for details.
<h3 class=fn>void <a name="setIsMenuButton"></a>QPushButton::setIsMenuButton ( bool&nbsp;enable )<tt> [virtual]</tt>
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> 

<h3 class=fn>void <a name="setOn"></a>QPushButton::setOn ( bool )<tt> [virtual slot]</tt>
</h3><p>Sets whether the push button is toggled.
See the <a href="qpushbutton.html#on-prop">"on"</a> property for details.
<h3 class=fn>void <a name="setPixmap"></a>QButton::setPixmap ( const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp; )<tt> [virtual]</tt>
</h3><p>Sets the pixmap shown on the button.
See the <a href="qbutton.html#pixmap-prop">"pixmap"</a> property for details.
<h3 class=fn>void <a name="setPopup"></a>QPushButton::setPopup ( <a href="qpopupmenu.html">QPopupMenu</a>&nbsp;*&nbsp;popup )
</h3>
Associates the popup menu <em>popup</em> with this push button and
thus turns it into a menu button.
<p> Ownership of the popup menu is <em>not</em> transferred to the push button.
<p> <p>See also <a href="#popup">popup</a>().

<p>Example: <a href="qdir-example.html#x794">qdir/qdir.cpp</a>.
<h3 class=fn>void <a name="setText"></a>QButton::setText ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp; )<tt> [virtual]</tt>
</h3><p>Sets the text shown on the button.
See the <a href="qbutton.html#text-prop">"text"</a> property for details.
<h3 class=fn>void <a name="setToggleButton"></a>QPushButton::setToggleButton ( bool )
</h3><p>Sets whether the button is a toggle button.
See the <a href="qpushbutton.html#toggleButton-prop">"toggleButton"</a> property for details.
<h3 class=fn><a href="qbutton.html#ToggleState-enum">ToggleState</a> <a name="state"></a>QButton::state () const
</h3><p>Returns TRUE if the button is toggled; otherwise returns FALSE.
See the <a href="qbutton.html#toggleState-prop">"toggleState"</a> property for details.
<h3 class=fn>void <a name="stateChanged"></a>QButton::stateChanged ( int&nbsp;state )<tt> [signal]</tt>
</h3>

This signal is emitted whenever a toggle button changes status.
<em>state</em> is 2 if the button is on, 1 if it is in the
<a href="qcheckbox.html#setTristate">"no change" state</a>
or 0 if the button is off.
<p> This may be the result of a user action, <a href="qbutton.html#toggle">toggle</a>() slot activation,
<a href="qbutton.html#setState">setState</a>(), or because <a href="#setOn">setOn</a>() was called.
<p> <p>See also <a href="qbutton.html#clicked">clicked</a>().

<h3 class=fn><a href="qstring.html">QString</a> <a name="text"></a>QButton::text () const
</h3><p>Returns the text shown on the button.
See the <a href="qbutton.html#text-prop">"text"</a> property for details.
<h3 class=fn>void <a name="toggle"></a>QButton::toggle ()<tt> [slot]</tt>
</h3>
Toggles the state of a toggle button.
<p>See also <a href="#on-prop">on</a>, <a href="#on-prop">on</a>, <a href="qbutton.html#toggled">toggled</a>() and <a href="#toggleButton-prop">toggleButton</a>.

<h3 class=fn>void <a name="toggled"></a>QButton::toggled ( bool&nbsp;on )<tt> [signal]</tt>
</h3>

This signal is emitted whenever a toggle button changes status.
<em>on</em> is TRUE if the button is on, or FALSE if the button is off.
<p> This may be the result of a user action, <a href="qbutton.html#toggle">toggle</a>() slot activation,
or because <a href="#setOn">setOn</a>() was called.
<p> <p>See also <a href="qbutton.html#clicked">clicked</a>().

<p>Example: <a href="listbox-example.html#x1268">listbox/listbox.cpp</a>.
<hr><h2>Property Documentation</h2>
<h3 class=fn><a href="qkeysequence.html">QKeySequence</a> <a name="accel-prop"></a>accel</h3> <p>This property holds the accelerator associated with the button.
<p>This property is 0 if there is no accelerator set. If you set
this property to 0 then any current accelerator is removed.

<p>Set this property's value with <a href="#setAccel">setAccel</a>() and get this property's value with <a href="#accel">accel</a>().
<h3 class=fn>bool <a name="autoDefault-prop"></a>autoDefault</h3> <p>This property holds whether the push button is the auto default button.
<p>If this property is set to TRUE then the push button will be the focused
item in a dialog when the dialog is first shown.
<p> This property's default is TRUE.

<p>Set this property's value with <a href="#setAutoDefault">setAutoDefault</a>() and get this property's value with <a href="#autoDefault">autoDefault</a>().
<h3 class=fn>bool <a name="autoMask-prop"></a>autoMask</h3> <p>This property holds whether the button is automatically masked.
<p><p><p>See also <a href="qwidget.html#autoMask-prop">QWidget::autoMask</a>.

<h3 class=fn>bool <a name="autoRepeat-prop"></a>autoRepeat</h3> <p>This property holds whether autoRepeat is enabled.
<p>If autoRepeat is enabled then the <a href="qbutton.html#clicked">clicked</a>() signal is emitted at
regular intervals if the button is down.  This property has
no effect on toggle buttons. autoRepeat is off by default.

<p>Set this property's value with <a href="#setAutoRepeat">setAutoRepeat</a>() and get this property's value with <a href="#autoRepeat">autoRepeat</a>().
<h3 class=fn>bool <a name="default-prop"></a>default</h3> <p>This property holds whether the push button is the default button.
<p>If this property is set to TRUE then the push button will be pressed if the
user hits the Enter key in a dialog.
<p> This property's default is FALSE.

<p>Set this property's value with <a href="#setDefault">setDefault</a>() and get this property's value with <a href="#isDefault">isDefault</a>().
<h3 class=fn>bool <a name="flat-prop"></a>flat</h3> <p>This property holds whether the border is disabled.
<p>This property's default is FALSE.

<p>Set this property's value with <a href="#setFlat">setFlat</a>() and get this property's value with <a href="#isFlat">isFlat</a>().
<h3 class=fn><a href="qiconset.html">QIconSet</a> <a name="iconSet-prop"></a>iconSet</h3> <p>This property holds the icon set on the push button.
<p>This property will return 0 if the push button has no iconset

<p>Set this property's value with <a href="#setIconSet">setIconSet</a>() and get this property's value with <a href="#iconSet">iconSet</a>().
<h3 class=fn>bool <a name="menuButton-prop"></a>menuButton</h3> <p>This property holds whether the push button has a menu button on it.
<p><b>This property is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> If this property is set to TRUE, then a down arrow is drawn on the push
button to indicate that a menu will pop up if the user clicks on the
arrow.

<p>Get this property's value with <a href="#isMenuButton">isMenuButton</a>().
<h3 class=fn>bool <a name="on-prop"></a>on</h3> <p>This property holds whether the push button is toggled.
<p>This property should only be set for toggle push buttons. The
default value is FALSE.
<p>See also <a href="#on-prop">on</a>, <a href="qbutton.html#toggle">toggle</a>(), <a href="qbutton.html#toggled">toggled</a>() and <a href="#toggleButton-prop">toggleButton</a>.

<p>Set this property's value with <a href="#setOn">setOn</a>().
<h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="pixmap-prop"></a>pixmap</h3> <p>This property holds the pixmap shown on the button.
<p>If the pixmap is monochrome (i.e., it is a <a href="qbitmap.html">QBitmap</a> or its <a href="qpixmap.html#depth">depth</a> is 1) and it does not have a mask,
this property will set the pixmap to be its own mask. The purpose of
this is to draw transparent bitmaps which are important for
toggle buttons, for example.
<p> <a href="qbutton.html#pixmap">pixmap</a>() returns 0 if no pixmap was set.

<p>Set this property's value with <a href="#setPixmap">setPixmap</a>() and get this property's value with <a href="#pixmap">pixmap</a>().
<h3 class=fn><a href="qstring.html">QString</a> <a name="text-prop"></a>text</h3> <p>This property holds the text shown on the button.
<p>This property will return a null string if the button has
no text.  If the text has an ampersand ('&amp;') in it, then an
accelerator is automatically created for it using the
character after the '&amp;' as the accelerator key.
<p> There is no default text.

<p>Set this property's value with <a href="#setText">setText</a>() and get this property's value with <a href="#text">text</a>().
<h3 class=fn>bool <a name="toggleButton-prop"></a>toggleButton</h3> <p>This property holds whether the button is a toggle button.
<p>Toggle buttons have an on/off state similar to <a href="qcheckbox.html">check
  boxes.</a> A push button is initially not a toggle button.
<p> <p>See also <a href="#on-prop">on</a>, <a href="qbutton.html#toggle">toggle</a>(), <a href="#toggleButton-prop">toggleButton</a> and <a href="qbutton.html#toggled">toggled</a>().

<p>Set this property's value with <a href="#setToggleButton">setToggleButton</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2001
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>