File: qdialogbuttonbox.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (192 lines) | stat: -rw-r--r-- 33,777 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDialogButtonBox Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDialogButtonBox Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QDialogButtonBox class is a widget that presents buttons in a layout that is appropriate to the current widget style. <a href="#details">More...</a></p>
<p>Inherits <a href="qwidget.html">QWidget</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdialogbuttonbox.html#ButtonLayout-enum">ButtonLayout</a></b> { WinLayout, MacLayout, KdeLayout, GnomeLayout }</li><li><div class="fn" />enum <b><a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a></b> { InvalidRole, AcceptRole, RejectRole, DestructiveRole, ..., ApplyRole }</li><li><div class="fn" />enum <b><a href="qdialogbuttonbox.html#StandardButton-enum">StandardButton</a></b> { NoButton, Ok, Save, SaveAll, ..., RestoreDefaults }</li><li><div class="fn" />class <b><a href="qdialogbuttonbox-standardbuttons.html">StandardButtons</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdialogbuttonbox.html#QDialogButtonBox">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#QDialogButtonBox-2">__init__</a></b> (<i>self</i>, Qt.Orientation, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#QDialogButtonBox-3">__init__</a></b> (<i>self</i>, StandardButtons, Qt.Orientation&#160;<i>orientation</i>&#160;=&#160;Qt.Horizontal, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#addButton">addButton</a></b> (<i>self</i>, QAbstractButton, ButtonRole)</li><li><div class="fn" />QPushButton <b><a href="qdialogbuttonbox.html#addButton-2">addButton</a></b> (<i>self</i>, QString, ButtonRole)</li><li><div class="fn" />QPushButton <b><a href="qdialogbuttonbox.html#addButton-3">addButton</a></b> (<i>self</i>, StandardButton)</li><li><div class="fn" />QPushButton <b><a href="qdialogbuttonbox.html#button">button</a></b> (<i>self</i>, StandardButton)</li><li><div class="fn" />ButtonRole <b><a href="qdialogbuttonbox.html#buttonRole">buttonRole</a></b> (<i>self</i>, QAbstractButton)</li><li><div class="fn" />list-of-QAbstractButton <b><a href="qdialogbuttonbox.html#buttons">buttons</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdialogbuttonbox.html#centerButtons">centerButtons</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#changeEvent">changeEvent</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#clear">clear</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdialogbuttonbox.html#event">event</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />Qt.Orientation <b><a href="qdialogbuttonbox.html#orientation">orientation</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#removeButton">removeButton</a></b> (<i>self</i>, QAbstractButton)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#setCenterButtons">setCenterButtons</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#setOrientation">setOrientation</a></b> (<i>self</i>, Qt.Orientation)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#setStandardButtons">setStandardButtons</a></b> (<i>self</i>, StandardButtons)</li><li><div class="fn" />StandardButton <b><a href="qdialogbuttonbox.html#standardButton">standardButton</a></b> (<i>self</i>, QAbstractButton)</li><li><div class="fn" />StandardButtons <b><a href="qdialogbuttonbox.html#standardButtons">standardButtons</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qdialogbuttonbox.html#accepted">accepted</a></b> ()</li><li><div class="fn" />void <b><a href="qdialogbuttonbox.html#clicked">clicked</a></b> (QAbstractButton *)</li><li><div class="fn" />void <b><a href="qdialogbuttonbox.html#helpRequested">helpRequested</a></b> ()</li><li><div class="fn" />void <b><a href="qdialogbuttonbox.html#rejected">rejected</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDialogButtonBox class is a widget that presents buttons in a layout that is appropriate to the current widget style.</p>
<p>Dialogs and message boxes typically present buttons in a layout that conforms to the interface guidelines for that platform. Invariably, different platforms have different layouts for their dialogs. QDialogButtonBox allows a developer to add buttons to it and will automatically use the appropriate layout for the user's desktop environment.</p>
<p>Most buttons for a dialog follow certain roles. Such roles include:</p>
<ul>
<li>Accepting or rejecting the dialog.</li>
<li>Asking for help.</li>
<li>Performing actions on the dialog itself (such as resetting fields or applying changes).</li>
</ul>
<p>There can also be alternate ways of dismissing the dialog which may cause destructive results.</p>
<p>Most dialogs have buttons that can almost be considered standard (e.g. <b>OK</b> and <b>Cancel</b> buttons). It is sometimes convenient to create these buttons in a standard way.</p>
<p>There are a couple ways of using QDialogButtonBox. One ways is to create the buttons (or button texts) yourself and add them to the button box, specifying their role.</p>
<pre>     findButton = new QPushButton(tr("&amp;Find"));
     findButton-&gt;setDefault(true);

     moreButton = new QPushButton(tr("&amp;More"));
     moreButton-&gt;setCheckable(true);
     moreButton-&gt;setAutoDefault(false);

     buttonBox = new QDialogButtonBox(Qt.Vertical);
     buttonBox-&gt;addButton(findButton, QDialogButtonBox.ActionRole);
     buttonBox-&gt;addButton(moreButton, QDialogButtonBox.ActionRole);</pre>
<p>Alternatively, QDialogButtonBox provides several standard buttons (e.g. OK, Cancel, Save) that you can use. They exist as flags so you can OR them together in the constructor.</p>
<pre>     buttonBox = new QDialogButtonBox(QDialogButtonBox.Ok
                                      | QDialogButtonBox.Cancel);

     connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
     connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));</pre>
<p>You can mix and match normal buttons and standard buttons.</p>
<p>Currently the buttons are laid out in the following way if the button box is horizontal:</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic" width="100%">
<tr class="odd" valign="top"><td><img alt="GnomeLayout Horizontal" src="images/buttonbox-gnomelayout-horizontal.png" /></td><td>Button box laid out in horizontal <a href="qdialogbuttonbox.html#ButtonLayout-enum">GnomeLayout</a></td></tr>
<tr class="even" valign="top"><td><img alt="KdeLayout Horizontal" src="images/buttonbox-kdelayout-horizontal.png" /></td><td>Button box laid out in horizontal <a href="qdialogbuttonbox.html#ButtonLayout-enum">KdeLayout</a></td></tr>
<tr class="odd" valign="top"><td><img alt="MacLayout Horizontal" src="images/buttonbox-maclayout-horizontal.png" /></td><td>Button box laid out in horizontal <a href="qdialogbuttonbox.html#ButtonLayout-enum">MacLayout</a></td></tr>
<tr class="even" valign="top"><td><img alt="WinLayout Horizontal" src="images/buttonbox-winlayout-horizontal.png" /></td><td>Button box laid out in horizontal <a href="qdialogbuttonbox.html#ButtonLayout-enum">WinLayout</a></td></tr>
</table></p>
<p>The buttons are laid out the following way if the button box is vertical:</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic" width="100%">
<tr class="odd" valign="top"><td><img alt="GnomeLayout Vertical" src="images/buttonbox-gnomelayout-vertical.png" /></td><td>Button box laid out in vertical <a href="qdialogbuttonbox.html#ButtonLayout-enum">GnomeLayout</a></td></tr>
<tr class="even" valign="top"><td><img alt="KdeLayout Vertical" src="images/buttonbox-kdelayout-vertical.png" /></td><td>Button box laid out in vertical <a href="qdialogbuttonbox.html#ButtonLayout-enum">KdeLayout</a></td></tr>
<tr class="odd" valign="top"><td><img alt="MacLayout Vertical" src="images/buttonbox-maclayout-vertical.png" /></td><td>Button box laid out in vertical <a href="qdialogbuttonbox.html#ButtonLayout-enum">MacLayout</a></td></tr>
<tr class="even" valign="top"><td><img alt="WinLayout Vertical" src="images/buttonbox-winlayout-vertical.png" /></td><td>Button box laid out in vertical <a href="qdialogbuttonbox.html#ButtonLayout-enum">WinLayout</a></td></tr>
</table></p>
<p>Additionally, button boxes that contain only buttons with <a href="qdialogbuttonbox.html#ButtonRole-enum">ActionRole</a> or <a href="qdialogbuttonbox.html#ButtonRole-enum">HelpRole</a> can be considered modeless and have an alternate look on the mac:</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic" width="100%">
<tr class="odd" valign="top"><td><img alt="Screenshot of modeless horizontal MacLayout" src="images/buttonbox-mac-modeless-horizontal.png" /></td><td>modeless horizontal <a href="qdialogbuttonbox.html#ButtonLayout-enum">MacLayout</a></td></tr>
<tr class="even" valign="top"><td><img alt="Screenshot of modeless vertical MacLayout" src="images/buttonbox-mac-modeless-vertical.png" /></td><td>modeless vertical <a href="qdialogbuttonbox.html#ButtonLayout-enum">MacLayout</a></td></tr>
</table></p>
<p>When a button is clicked in the button box, the <a href="qdialogbuttonbox.html#clicked">clicked</a>() signal is emitted for the actual button is that is pressed. For convenience, if the button has an <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>, <a href="qdialogbuttonbox.html#ButtonRole-enum">RejectRole</a>, or <a href="qdialogbuttonbox.html#ButtonRole-enum">HelpRole</a>, the <a href="qdialogbuttonbox.html#accepted">accepted</a>(), <a href="qdialogbuttonbox.html#rejected">rejected</a>(), or <a href="qdialogbuttonbox.html#helpRequested">helpRequested</a>() signals are emitted respectively.</p>
<p>If you want a specific button to be default you need to call <a href="qpushbutton.html#default-prop">QPushButton.setDefault</a>() on it yourself. However, if there is no default button set and to preserve which button is the default button across platforms when using the <a href="qpushbutton.html#autoDefault-prop">QPushButton.autoDefault</a> property, the first push button with the accept role is made the default button when the QDialogButtonBox is shown,</p>
<p>See also <a href="qmessagebox.html">QMessageBox</a>, <a href="qpushbutton.html">QPushButton</a>, and <a href="qdialog.html">QDialog</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ButtonLayout-enum" />QDialogButtonBox.ButtonLayout</h3><p>This enum describes the layout policy to be used when arranging the buttons contained in the button box.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QDialogButtonBox.WinLayout</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Use a policy appropriate for applications on Windows.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.MacLayout</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Use a policy appropriate for applications on Mac OS X.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.KdeLayout</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Use a policy appropriate for applications on KDE.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.GnomeLayout</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Use a policy appropriate for applications on GNOME.</td></tr>
</table></p>
<p>The button layout is specified by the <a href="qwidget.html#style">current style</a>. However, on the X11 platform, it may be influenced by the desktop environment.</p>
<a name="//apple_ref/cpp/tag/QDialogButtonBox/ButtonRole" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/InvalidRole" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/AcceptRole" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/RejectRole" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/DestructiveRole" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/ActionRole" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/HelpRole" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/YesRole" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/NoRole" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/ApplyRole" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/ResetRole" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/NRoles" />
<h3 class="fn"><a name="ButtonRole-enum" />QDialogButtonBox.ButtonRole</h3><p>This enum describes the roles that can be used to describe buttons in the button box. Combinations of these roles are as flags used to describe different aspects of their behavior.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QDialogButtonBox.InvalidRole</tt></td><td align="center" valign="top"><tt>-1</tt></td><td valign="top">The button is invalid.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.AcceptRole</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Clicking the button causes the dialog to be accepted (e.g. OK).</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.RejectRole</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Clicking the button causes the dialog to be rejected (e.g. Cancel).</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.DestructiveRole</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Clicking the button causes a destructive change (e.g. for Discarding Changes) and closes the dialog.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.ActionRole</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Clicking the button causes changes to the elements within the dialog.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.HelpRole</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">The button can be clicked to request help.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.YesRole</tt></td><td align="center" valign="top"><tt>5</tt></td><td valign="top">The button is a "Yes"-like button.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.NoRole</tt></td><td align="center" valign="top"><tt>6</tt></td><td valign="top">The button is a "No"-like button.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.ApplyRole</tt></td><td align="center" valign="top"><tt>8</tt></td><td valign="top">The button applies current changes.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.ResetRole</tt></td><td align="center" valign="top"><tt>7</tt></td><td valign="top">The button resets the dialog's fields to default values.</td></tr>
</table></p>
<p>See also <a href="qdialogbuttonbox.html#StandardButton-enum">StandardButton</a>.</p>
<a name="//apple_ref/cpp/tag/QDialogButtonBox/StandardButton" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Ok" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Open" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Save" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Cancel" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Close" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Discard" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Apply" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Reset" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/RestoreDefaults" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Help" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/SaveAll" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Yes" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/YesToAll" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/No" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/NoToAll" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Abort" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Retry" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/Ignore" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/NoButton" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/FirstButton" />
<a name="//apple_ref/cpp/econst/QDialogButtonBox/LastButton" />
<a name="//apple_ref/cpp/tdef/QDialogButtonBox/StandardButtons" />
<h3 class="fn"><a name="StandardButton-enum" />QDialogButtonBox.StandardButton</h3><p>These enums describe flags for standard buttons. Each button has a defined <a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a>.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Ok</tt></td><td align="center" valign="top"><tt>0x00000400</tt></td><td valign="top">An "OK" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Open</tt></td><td align="center" valign="top"><tt>0x00002000</tt></td><td valign="top">A "Open" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Save</tt></td><td align="center" valign="top"><tt>0x00000800</tt></td><td valign="top">A "Save" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Cancel</tt></td><td align="center" valign="top"><tt>0x00400000</tt></td><td valign="top">A "Cancel" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">RejectRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Close</tt></td><td align="center" valign="top"><tt>0x00200000</tt></td><td valign="top">A "Close" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">RejectRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Discard</tt></td><td align="center" valign="top"><tt>0x00800000</tt></td><td valign="top">A "Discard" or "Don't Save" button, depending on the platform, defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">DestructiveRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Apply</tt></td><td align="center" valign="top"><tt>0x02000000</tt></td><td valign="top">An "Apply" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">ApplyRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Reset</tt></td><td align="center" valign="top"><tt>0x04000000</tt></td><td valign="top">A "Reset" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">ResetRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.RestoreDefaults</tt></td><td align="center" valign="top"><tt>0x08000000</tt></td><td valign="top">A "Restore Defaults" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">ResetRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Help</tt></td><td align="center" valign="top"><tt>0x01000000</tt></td><td valign="top">A "Help" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">HelpRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.SaveAll</tt></td><td align="center" valign="top"><tt>0x00001000</tt></td><td valign="top">A "Save All" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Yes</tt></td><td align="center" valign="top"><tt>0x00004000</tt></td><td valign="top">A "Yes" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">YesRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.YesToAll</tt></td><td align="center" valign="top"><tt>0x00008000</tt></td><td valign="top">A "Yes to All" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">YesRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.No</tt></td><td align="center" valign="top"><tt>0x00010000</tt></td><td valign="top">A "No" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">NoRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.NoToAll</tt></td><td align="center" valign="top"><tt>0x00020000</tt></td><td valign="top">A "No to All" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">NoRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Abort</tt></td><td align="center" valign="top"><tt>0x00040000</tt></td><td valign="top">An "Abort" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">RejectRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Retry</tt></td><td align="center" valign="top"><tt>0x00080000</tt></td><td valign="top">A "Retry" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.Ignore</tt></td><td align="center" valign="top"><tt>0x00100000</tt></td><td valign="top">An "Ignore" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
<tr><td valign="top"><tt>QDialogButtonBox.NoButton</tt></td><td align="center" valign="top"><tt>0x00000000</tt></td><td valign="top">An invalid button.</td></tr>
</table></p>
<p>The StandardButtons type is a typedef for <a href="qflags.html">QFlags</a>&lt;StandardButton&gt;. It stores an OR combination of StandardButton values.</p>
<p>See also <a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a> and <a href="qdialogbuttonbox.html#standardButtons-prop">standardButtons</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDialogButtonBox" />QDialogButtonBox.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an empty, horizontal button box with the given <i>parent</i>.</p>
<p>See also <a href="qdialogbuttonbox.html#orientation-prop">orientation</a> and <a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>
<h3 class="fn"><a name="QDialogButtonBox-2" />QDialogButtonBox.__init__ (<i>self</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an empty button box with the given <i>orientation</i> and <i>parent</i>.</p>
<p>See also <a href="qdialogbuttonbox.html#orientation-prop">orientation</a> and <a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>
<h3 class="fn"><a name="QDialogButtonBox-3" />QDialogButtonBox.__init__ (<i>self</i>, <a href="qdialogbuttonbox-standardbuttons.html">StandardButtons</a>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>&#160;=&#160;Qt.Horizontal, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a button box with the given <i>orientation</i> and <i>parent</i>, containing the standard buttons specified by <i>buttons</i>.</p>
<p>See also <a href="qdialogbuttonbox.html#orientation-prop">orientation</a> and <a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/~QDialogButtonBox" />
<h3 class="fn"><a name="addButton" />QDialogButtonBox.addButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>, <a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a>)</h3><p>The <i>QAbstractButton</i> argument has it's ownership transferred to Qt.</p><p>Adds the given <i>button</i> to the button box with the specified <i>role</i>. If the role is invalid, the button is not added.</p>
<p>If the button has already been added, it is removed and added again with the new role.</p>
<p>See also <a href="qdialogbuttonbox.html#removeButton">removeButton</a>() and <a href="qdialogbuttonbox.html#clear">clear</a>().</p>
<h3 class="fn"><a name="addButton-2" /><a href="qpushbutton.html">QPushButton</a> QDialogButtonBox.addButton (<i>self</i>, QString, <a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a>)</h3><p>Creates a push button with the given <i>text</i>, adds it to the button box for the specified <i>role</i>, and returns the corresponding push button. If <i>role</i> is invalid, no button is created, and zero is returned.</p>
<p>See also <a href="qdialogbuttonbox.html#removeButton">removeButton</a>() and <a href="qdialogbuttonbox.html#clear">clear</a>().</p>
<h3 class="fn"><a name="addButton-3" /><a href="qpushbutton.html">QPushButton</a> QDialogButtonBox.addButton (<i>self</i>, <a href="qdialogbuttonbox.html#StandardButton-enum">StandardButton</a>)</h3><p>Adds a standard <i>button</i> to the button box if it is valid to do so, and returns a push button. If <i>button</i> is invalid, it is not added to the button box, and zero is returned.</p>
<p>See also <a href="qdialogbuttonbox.html#removeButton">removeButton</a>() and <a href="qdialogbuttonbox.html#clear">clear</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/button" />
<h3 class="fn"><a name="button" /><a href="qpushbutton.html">QPushButton</a> QDialogButtonBox.button (<i>self</i>, <a href="qdialogbuttonbox.html#StandardButton-enum">StandardButton</a>)</h3><p>Returns the <a href="qpushbutton.html">QPushButton</a> corresponding to the standard button <i>which</i>, or 0 if the standard button doesn't exist in this button box.</p>
<p>See also <a href="qdialogbuttonbox.html#standardButton">standardButton</a>(), <a href="qdialogbuttonbox.html#standardButtons-prop">standardButtons</a>(), and <a href="qdialogbuttonbox.html#buttons">buttons</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/buttonRole" />
<h3 class="fn"><a name="buttonRole" /><a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a> QDialogButtonBox.buttonRole (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>)</h3><p>Returns the button role for the specified <i>button</i>. This function returns <a href="qdialogbuttonbox.html#ButtonRole-enum">InvalidRole</a> if <i>button</i> is 0 or has not been added to the button box.</p>
<p>See also <a href="qdialogbuttonbox.html#buttons">buttons</a>() and <a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/buttons" />
<h3 class="fn"><a name="buttons" />list-of-QAbstractButton QDialogButtonBox.buttons (<i>self</i>)</h3><p>Returns a list of all the buttons that have been added to the button box.</p>
<p>See also <a href="qdialogbuttonbox.html#buttonRole">buttonRole</a>(), <a href="qdialogbuttonbox.html#addButton">addButton</a>(), and <a href="qdialogbuttonbox.html#removeButton">removeButton</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/changeEvent" />
<h3 class="fn"><a name="centerButtons" />bool QDialogButtonBox.centerButtons (<i>self</i>)</h3><h3 class="fn"><a name="changeEvent" />QDialogButtonBox.changeEvent (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget.changeEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/clear" />
<h3 class="fn"><a name="clear" />QDialogButtonBox.clear (<i>self</i>)</h3><p>Clears the button box, deleting all buttons within it.</p>
<p>See also <a href="qdialogbuttonbox.html#removeButton">removeButton</a>() and <a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/clicked" />
<h3 class="fn"><a name="event" />bool QDialogButtonBox.event (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/helpRequested" />
<h3 class="fn"><a name="orientation" /><a href="qt.html#Orientation-enum">Qt.Orientation</a> QDialogButtonBox.orientation (<i>self</i>)</h3><h3 class="fn"><a name="removeButton" />QDialogButtonBox.removeButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>)</h3><p>The <i>QAbstractButton</i> argument</p><p>Removes <i>button</i> from the button box without deleting it and sets its parent to zero.</p>
<p>See also <a href="qdialogbuttonbox.html#clear">clear</a>(), <a href="qdialogbuttonbox.html#buttons">buttons</a>(), and <a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/standardButton" />
<h3 class="fn"><a name="setCenterButtons" />QDialogButtonBox.setCenterButtons (<i>self</i>, bool)</h3><h3 class="fn"><a name="setOrientation" />QDialogButtonBox.setOrientation (<i>self</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>)</h3><h3 class="fn"><a name="setStandardButtons" />QDialogButtonBox.setStandardButtons (<i>self</i>, <a href="qdialogbuttonbox-standardbuttons.html">StandardButtons</a>)</h3><h3 class="fn"><a name="standardButton" /><a href="qdialogbuttonbox.html#StandardButton-enum">StandardButton</a> QDialogButtonBox.standardButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>)</h3><p>Returns the standard button enum value corresponding to the given <i>button</i>, or <a href="qdialogbuttonbox.html#StandardButton-enum">NoButton</a> if the given <i>button</i> isn't a standard button.</p>
<p>See also <a href="qdialogbuttonbox.html#button">button</a>(), <a href="qdialogbuttonbox.html#buttons">buttons</a>(), and <a href="qdialogbuttonbox.html#standardButtons-prop">standardButtons</a>().</p>
<p /><h3 class="fn"><a name="standardButtons" /><a href="qdialogbuttonbox-standardbuttons.html">StandardButtons</a> QDialogButtonBox.standardButtons (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="accepted" />void accepted ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a button inside the button box is clicked, as long as it was defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a> or <a href="qdialogbuttonbox.html#ButtonRole-enum">YesRole</a>.</p>
<p>See also <a href="qdialogbuttonbox.html#rejected">rejected</a>(), <a href="qdialogbuttonbox.html#clicked">clicked</a>(), and <a href="qdialogbuttonbox.html#helpRequested">helpRequested</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/addButton" />
<h3 class="fn"><a name="clicked" />void clicked (QAbstractButton *)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a button inside the button box is clicked. The specific button that was pressed is specified by <i>button</i>.</p>
<p>See also <a href="qdialogbuttonbox.html#accepted">accepted</a>(), <a href="qdialogbuttonbox.html#rejected">rejected</a>(), and <a href="qdialogbuttonbox.html#helpRequested">helpRequested</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/event" />
<h3 class="fn"><a name="helpRequested" />void helpRequested ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a button inside the button box is clicked, as long as it was defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">HelpRole</a>.</p>
<p>See also <a href="qdialogbuttonbox.html#accepted">accepted</a>(), <a href="qdialogbuttonbox.html#rejected">rejected</a>(), and <a href="qdialogbuttonbox.html#clicked">clicked</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/rejected" />
<h3 class="fn"><a name="rejected" />void rejected ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a button inside the button box is clicked, as long as it was defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">RejectRole</a> or <a href="qdialogbuttonbox.html#ButtonRole-enum">NoRole</a>.</p>
<p>See also <a href="qdialogbuttonbox.html#accepted">accepted</a>(), <a href="qdialogbuttonbox.html#helpRequested">helpRequested</a>(), and <a href="qdialogbuttonbox.html#clicked">clicked</a>().</p>
<a name="//apple_ref/cpp/instm/QDialogButtonBox/removeButton" />
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>