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/dialogs/qdialog.cpp:59 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QDialog 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>QDialog Class Reference</h1>
|
---|
33 |
|
---|
34 | <p>The QDialog class is the base class of dialog windows.
|
---|
35 | <a href="#details">More...</a>
|
---|
36 | <p><tt>#include <<a href="qdialog-h.html">qdialog.h</a>></tt>
|
---|
37 | <p>Inherits <a href="qwidget.html">QWidget</a>.
|
---|
38 | <p>Inherited by <a href="qcolordialog.html">QColorDialog</a>, <a href="qerrormessage.html">QErrorMessage</a>, <a href="qfiledialog.html">QFileDialog</a>, <a href="qfontdialog.html">QFontDialog</a>, <a href="qinputdialog.html">QInputDialog</a>, <a href="qmessagebox.html">QMessageBox</a>, <a href="qmotifdialog.html">QMotifDialog</a>, <a href="qprogressdialog.html">QProgressDialog</a>, <a href="qtabdialog.html">QTabDialog</a>, and <a href="qwizard.html">QWizard</a>.
|
---|
39 | <p><a href="qdialog-members.html">List of all member functions.</a>
|
---|
40 | <h2>Public Members</h2>
|
---|
41 | <ul>
|
---|
42 | <li class=fn>explicit <a href="#QDialog"><b>QDialog</b></a> ( QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags f = 0 )</li>
|
---|
43 | <li class=fn><a href="#~QDialog"><b>~QDialog</b></a> ()</li>
|
---|
44 | <li class=fn>enum <a href="#DialogCode-enum"><b>DialogCode</b></a> { Rejected, Accepted }</li>
|
---|
45 | <li class=fn>int <a href="#result"><b>result</b></a> () const</li>
|
---|
46 | <li class=fn>virtual void <a href="#show"><b>show</b></a> ()</li>
|
---|
47 | <li class=fn>void <a href="#setOrientation"><b>setOrientation</b></a> ( Orientation orientation )</li>
|
---|
48 | <li class=fn>Orientation <a href="#orientation"><b>orientation</b></a> () const</li>
|
---|
49 | <li class=fn>void <a href="#setExtension"><b>setExtension</b></a> ( QWidget * extension )</li>
|
---|
50 | <li class=fn>QWidget * <a href="#extension"><b>extension</b></a> () const</li>
|
---|
51 | <li class=fn>void <a href="#setSizeGripEnabled"><b>setSizeGripEnabled</b></a> ( bool )</li>
|
---|
52 | <li class=fn>bool <a href="#isSizeGripEnabled"><b>isSizeGripEnabled</b></a> () const</li>
|
---|
53 | <li class=fn>void <a href="#setModal"><b>setModal</b></a> ( bool modal )</li>
|
---|
54 | <li class=fn>bool <a href="#isModal"><b>isModal</b></a> () const</li>
|
---|
55 | </ul>
|
---|
56 | <h2>Public Slots</h2>
|
---|
57 | <ul>
|
---|
58 | <li class=fn>int <a href="#exec"><b>exec</b></a> ()</li>
|
---|
59 | </ul>
|
---|
60 | <h2>Properties</h2>
|
---|
61 | <ul>
|
---|
62 | <li class=fn>bool <a href="#modal-prop"><b>modal</b></a> - whether show() should pop up the dialog as modal or modeless</li>
|
---|
63 | <li class=fn>bool <a href="#sizeGripEnabled-prop"><b>sizeGripEnabled</b></a> - whether the size grip is enabled</li>
|
---|
64 | </ul>
|
---|
65 | <h2>Protected Members</h2>
|
---|
66 | <ul>
|
---|
67 | <li class=fn>void <a href="#setResult"><b>setResult</b></a> ( int i )</li>
|
---|
68 | </ul>
|
---|
69 | <h2>Protected Slots</h2>
|
---|
70 | <ul>
|
---|
71 | <li class=fn>virtual void <a href="#done"><b>done</b></a> ( int r )</li>
|
---|
72 | <li class=fn>virtual void <a href="#accept"><b>accept</b></a> ()</li>
|
---|
73 | <li class=fn>virtual void <a href="#reject"><b>reject</b></a> ()</li>
|
---|
74 | <li class=fn>void <a href="#showExtension"><b>showExtension</b></a> ( bool showIt )</li>
|
---|
75 | </ul>
|
---|
76 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
77 |
|
---|
78 |
|
---|
79 | The QDialog class is the base class of dialog windows.
|
---|
80 | <p>
|
---|
81 |
|
---|
82 |
|
---|
83 | <p> A dialog window is a top-level window mostly used for short-term
|
---|
84 | tasks and brief communications with the user. QDialogs may be
|
---|
85 | modal or modeless. QDialogs support <a href="#extensibility">extensibility</a> and can provide a <a href="#return">return
|
---|
86 | value</a>. They can have <a href="#default">default
|
---|
87 | buttons</a>. QDialogs can also have a <a href="qsizegrip.html">QSizeGrip</a> in their
|
---|
88 | lower-right corner, using <a href="#setSizeGripEnabled">setSizeGripEnabled</a>().
|
---|
89 | <p> Note that QDialog uses the parent widget slightly differently from
|
---|
90 | other classes in Qt. A dialog is always a top-level widget, but if
|
---|
91 | it has a parent, its default location is centered on top of the
|
---|
92 | parent's top-level widget (if it is not top-level itself). It will
|
---|
93 | also share the parent's taskbar entry.
|
---|
94 | <p> <a name="modal"></a>
|
---|
95 | <h3> Modal Dialogs
|
---|
96 | </h3>
|
---|
97 | <a name="1"></a><p> A <b>modal</b> dialog is a dialog that blocks input to other
|
---|
98 | visible windows in the same application. Users must finish
|
---|
99 | interacting with the dialog and close it before they can access
|
---|
100 | any other window in the application. Dialogs that are used to
|
---|
101 | request a file name from the user or that are used to set
|
---|
102 | application preferences are usually modal.
|
---|
103 | <p> The most common way to display a modal dialog is to call its
|
---|
104 | <a href="#exec">exec</a>() function. When the user closes the dialog, exec() will
|
---|
105 | provide a useful <a href="#return">return value</a>. Typically we
|
---|
106 | connect a default button, e.g. "OK", to the <a href="#accept">accept</a>() slot and a
|
---|
107 | "Cancel" button to the <a href="#reject">reject</a>() slot, to get the dialog to close
|
---|
108 | and return the appropriate value. Alternatively you can connect to
|
---|
109 | the <a href="#done">done</a>() slot, passing it <a href="#DialogCode-enum">Accepted</a> or <a href="#DialogCode-enum">Rejected</a>.
|
---|
110 | <p> An alternative is to call <a href="#setModal">setModal</a>(TRUE), then <a href="#show">show</a>(). Unlike
|
---|
111 | exec(), show() returns control to the caller immediately. Calling
|
---|
112 | setModal(TRUE) is especially useful for progress dialogs, where
|
---|
113 | the user must have the ability to interact with the dialog, e.g.
|
---|
114 | to cancel a long running operation. If you use show() and
|
---|
115 | setModal(TRUE) together you must call
|
---|
116 | <a href="qapplication.html#processEvents">QApplication::processEvents</a>() periodically during processing to
|
---|
117 | enable the user to interact with the dialog. (See <a href="qprogressdialog.html">QProgressDialog</a>.)
|
---|
118 | <p> <a name="modeless"></a>
|
---|
119 | <h3> Modeless Dialogs
|
---|
120 | </h3>
|
---|
121 | <a name="1-1"></a><p> A <b>modeless</b> dialog is a dialog that operates
|
---|
122 | independently of other windows in the same application. Find and
|
---|
123 | replace dialogs in word-processors are often modeless to allow the
|
---|
124 | user to interact with both the application's main window and with
|
---|
125 | the dialog.
|
---|
126 | <p> Modeless dialogs are displayed using show(), which returns control
|
---|
127 | to the caller immediately.
|
---|
128 | <p> <a name="default"></a>
|
---|
129 | <h3> Default button
|
---|
130 | </h3>
|
---|
131 | <a name="1-2"></a><p> A dialog's <em>default</em> button is the button that's pressed when the
|
---|
132 | user presses Enter (Return). This button is used to signify that
|
---|
133 | the user accepts the dialog's settings and wants to close the
|
---|
134 | dialog. Use <a href="qpushbutton.html#setDefault">QPushButton::setDefault</a>(), <a href="qpushbutton.html#isDefault">QPushButton::isDefault</a>()
|
---|
135 | and <a href="qpushbutton.html#autoDefault">QPushButton::autoDefault</a>() to set and control the dialog's
|
---|
136 | default button.
|
---|
137 | <p> <a name="escapekey"></a>
|
---|
138 | <h3> Escape Key
|
---|
139 | </h3>
|
---|
140 | <a name="1-3"></a><p> If the user presses the Esc key in a dialog, <a href="#reject">QDialog::reject</a>()
|
---|
141 | will be called. This will cause the window to close: the <a href="qcloseevent.html">closeEvent</a> cannot be <a href="qcloseevent.html#ignore">ignored</a>.
|
---|
142 | <p> <a name="extensibility"></a>
|
---|
143 | <h3> Extensibility
|
---|
144 | </h3>
|
---|
145 | <a name="1-4"></a><p> Extensibility is the ability to show the dialog in two ways: a
|
---|
146 | partial dialog that shows the most commonly used options, and a
|
---|
147 | full dialog that shows all the options. Typically an extensible
|
---|
148 | dialog will initially appear as a partial dialog, but with a
|
---|
149 | "More" toggle button. If the user presses the "More" button down,
|
---|
150 | the full dialog will appear. The extension widget will be resized
|
---|
151 | to its <a href="qwidget.html#sizeHint">sizeHint</a>(). If orientation is <a href="qt.html#Orientation-enum">Horizontal</a> the extension
|
---|
152 | widget's <a href="qwidget.html#height">height</a>() will be expanded to the height() of the dialog.
|
---|
153 | If the orientation is <a href="qt.html#Orientation-enum">Vertical</a> the extension widget's <a href="qwidget.html#width">width</a>()
|
---|
154 | will be expanded to the width() of the dialog. Extensibility is
|
---|
155 | controlled with <a href="#setExtension">setExtension</a>(), <a href="#setOrientation">setOrientation</a>() and
|
---|
156 | <a href="#showExtension">showExtension</a>().
|
---|
157 | <p> <a name="return"></a>
|
---|
158 | <h3> Return value (modal dialogs)
|
---|
159 | </h3>
|
---|
160 | <a name="1-5"></a><p> Modal dialogs are often used in situations where a return value is
|
---|
161 | required, e.g. to indicate whether the user pressed "OK" or
|
---|
162 | "Cancel". A dialog can be closed by calling the <a href="#accept">accept</a>() or the
|
---|
163 | <a href="#reject">reject</a>() slots, and <a href="#exec">exec</a>() will return <a href="#DialogCode-enum">Accepted</a> or <a href="#DialogCode-enum">Rejected</a>
|
---|
164 | as appropriate. The exec() call returns the result of the dialog.
|
---|
165 | The result is also available from <a href="#result">result</a>() if the dialog has not
|
---|
166 | been destroyed. If the <a href="qt.html#WidgetFlags-enum">WDestructiveClose</a> flag is set, the
|
---|
167 | dialog is deleted after exec() returns.
|
---|
168 | <p> <a name="examples"></a>
|
---|
169 | <h3> Examples
|
---|
170 | </h3>
|
---|
171 | <a name="1-6"></a><p> A modal dialog.
|
---|
172 | <p>
|
---|
173 |
|
---|
174 | <pre> <a href="qfiledialog.html">QFileDialog</a> *dlg = new <a href="qfiledialog.html">QFileDialog</a>( workingDirectory,
|
---|
175 | <a href="qstring.html#QString-null">QString::null</a>, 0, 0, TRUE );
|
---|
176 | <a name="x2130"></a> dlg-><a href="qwidget.html#setCaption">setCaption</a>( QFileDialog::<a href="qobject.html#tr">tr</a>( "Open" ) );
|
---|
177 | <a name="x2128"></a> dlg-><a href="qfiledialog.html#setMode">setMode</a>( QFileDialog::ExistingFile );
|
---|
178 | <a href="qstring.html">QString</a> result;
|
---|
179 | <a name="x2126"></a> if ( dlg-><a href="#exec">exec</a>() == QDialog::<a href="#DialogCode-enum">Accepted</a> ) {
|
---|
180 | <a name="x2127"></a> result = dlg-><a href="qfiledialog.html#selectedFile">selectedFile</a>();
|
---|
181 | <a name="x2129"></a> workingDirectory = dlg-><a href="qfiledialog.html#url">url</a>();
|
---|
182 | }
|
---|
183 | delete dlg;
|
---|
184 | return result;
|
---|
185 | </pre>
|
---|
186 | <p> A modeless dialog. After the <a href="#show">show</a>() call, control returns to the main
|
---|
187 | event loop.
|
---|
188 |
|
---|
189 |
|
---|
190 | <pre> int main( int argc, char **argv )
|
---|
191 | {
|
---|
192 | <a href="qapplication.html">QApplication</a> a( argc, argv );
|
---|
193 | </pre><pre> int scale = 10;
|
---|
194 | </pre><pre> LifeDialog *life = new LifeDialog( scale );
|
---|
195 | <a name="x2133"></a> a.<a href="qapplication.html#setMainWidget">setMainWidget</a>( life );
|
---|
196 | <a name="x2134"></a> life-><a href="qwidget.html#setCaption">setCaption</a>("Qt Example - Life");
|
---|
197 | <a name="x2135"></a> life-><a href="qwidget.html#show">show</a>();
|
---|
198 | </pre><pre> <a name="x2132"></a> return a.<a href="qapplication.html#exec">exec</a>();
|
---|
199 | }
|
---|
200 | </pre>
|
---|
201 | <p> <p>See also <a href="qtabdialog.html">QTabDialog</a>, <a href="qwidget.html">QWidget</a>, <a href="qprogressdialog.html">QProgressDialog</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Dialogs, Standard</a>, <a href="abstractwidgets.html">Abstract Widget Classes</a>, and <a href="dialogs.html">Dialog Classes</a>.
|
---|
202 |
|
---|
203 | <hr><h2>Member Type Documentation</h2>
|
---|
204 | <h3 class=fn><a name="DialogCode-enum"></a>QDialog::DialogCode</h3>
|
---|
205 | <p> The value returned by a modal dialog.
|
---|
206 | <ul>
|
---|
207 | <li><tt>QDialog::Accepted</tt>
|
---|
208 | <li><tt>QDialog::Rejected</tt>
|
---|
209 | </ul><p>
|
---|
210 | <hr><h2>Member Function Documentation</h2>
|
---|
211 | <h3 class=fn>explicit <a name="QDialog"></a>QDialog::QDialog ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0, bool modal = FALSE, WFlags f = 0 )
|
---|
212 | </h3>
|
---|
213 | Constructs a dialog called <em>name</em>, with parent <em>parent</em>.
|
---|
214 | <p> A dialog is always a top-level widget, but if it has a parent, its
|
---|
215 | default location is centered on top of the parent. It will also
|
---|
216 | share the parent's taskbar entry.
|
---|
217 | <p> The widget flags <em>f</em> are passed on to the <a href="qwidget.html">QWidget</a> constructor.
|
---|
218 | If, for example, you don't want a What's This button in the titlebar
|
---|
219 | of the dialog, pass WStyle_Customize | WStyle_NormalBorder |
|
---|
220 | WStyle_Title | WStyle_SysMenu in <em>f</em>.
|
---|
221 | <p> <b>Warning:</b> In Qt 3.2, the <em>modal</em> flag is obsolete. There is now a
|
---|
222 | <a href="#setModal">setModal</a>() function that can be used for obtaining a modal behavior
|
---|
223 | when calling <a href="#show">show</a>(). This is rarely needed, because modal dialogs
|
---|
224 | are usually invoked using <a href="#exec">exec</a>(), which ignores the <em>modal</em> flag.
|
---|
225 | <p> <p>See also <a href="qwidget.html#setWFlags">QWidget::setWFlags</a>() and <a href="qt.html#WidgetFlags-enum">Qt::WidgetFlags</a>.
|
---|
226 |
|
---|
227 | <h3 class=fn><a name="~QDialog"></a>QDialog::~QDialog ()
|
---|
228 | </h3>
|
---|
229 | Destroys the QDialog, deleting all its children.
|
---|
230 |
|
---|
231 | <h3 class=fn>void <a name="accept"></a>QDialog::accept ()<tt> [virtual protected slot]</tt>
|
---|
232 | </h3>
|
---|
233 | Hides the modal dialog and sets the result code to <a href="#DialogCode-enum">Accepted</a>.
|
---|
234 | <p> <p>See also <a href="#reject">reject</a>() and <a href="#done">done</a>().
|
---|
235 |
|
---|
236 | <p>Examples: <a href="tutorial2-08.html#x2604">chart/setdataform.cpp</a> and <a href="distributor-example.html#x2654">distributor/distributor.ui.h</a>.
|
---|
237 | <h3 class=fn>void <a name="done"></a>QDialog::done ( int r )<tt> [virtual protected slot]</tt>
|
---|
238 | </h3> Closes the dialog and sets its result code to <em>r</em>. If this dialog
|
---|
239 | is shown with <a href="#exec">exec</a>(), <a href="#done">done</a>() causes the local event loop to finish,
|
---|
240 | and exec() to return <em>r</em>.
|
---|
241 | <p> As with <a href="qwidget.html#close">QWidget::close</a>(), done() deletes the dialog if the <a href="qt.html#WidgetFlags-enum">WDestructiveClose</a> flag is set. If the dialog is the application's
|
---|
242 | main widget, the application terminates. If the dialog is the
|
---|
243 | last window closed, the <a href="qapplication.html#lastWindowClosed">QApplication::lastWindowClosed</a>() signal is
|
---|
244 | emitted.
|
---|
245 | <p> <p>See also <a href="#accept">accept</a>(), <a href="#reject">reject</a>(), <a href="qapplication.html#mainWidget">QApplication::mainWidget</a>(), and <a href="qapplication.html#quit">QApplication::quit</a>().
|
---|
246 |
|
---|
247 | <h3 class=fn>int <a name="exec"></a>QDialog::exec ()<tt> [slot]</tt>
|
---|
248 | </h3>
|
---|
249 | Shows the dialog as a <a href="#modal">modal</a> dialog,
|
---|
250 | blocking until the user closes it. The function returns a <a href="#DialogCode-enum">DialogCode</a> result.
|
---|
251 | <p> Users cannot interact with any other window in the same
|
---|
252 | application until they close the dialog.
|
---|
253 | <p> <p>See also <a href="#show">show</a>() and <a href="#result">result</a>().
|
---|
254 |
|
---|
255 | <p>Examples: <a href="canvas-chart-example.html#x2877">chart/chartform.cpp</a>, <a href="motif-dialog-example.html#x2706">dialog/mainwindow.cpp</a>, <a href="i18n-example.html#x1936">i18n/main.cpp</a>, <a href="ftpclient-example.html#x739">network/ftpclient/ftpmainwindow.ui.h</a>, <a href="qdialog.html#x2126">network/networkprotocol/view.cpp</a>, <a href="qdir-example.html#x1812">qdir/qdir.cpp</a>, and <a href="wizard-example.html#x16">wizard/main.cpp</a>.
|
---|
256 | <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="extension"></a>QDialog::extension () const
|
---|
257 | </h3>
|
---|
258 | Returns the dialog's extension or 0 if no extension has been
|
---|
259 | defined.
|
---|
260 | <p> <p>See also <a href="#setExtension">setExtension</a>().
|
---|
261 |
|
---|
262 | <h3 class=fn>bool <a name="isModal"></a>QDialog::isModal () const
|
---|
263 | </h3><p>Returns TRUE if <a href="#show">show</a>() should pop up the dialog as modal or modeless; otherwise returns FALSE.
|
---|
264 | See the <a href="qdialog.html#modal-prop">"modal"</a> property for details.
|
---|
265 | <h3 class=fn>bool <a name="isSizeGripEnabled"></a>QDialog::isSizeGripEnabled () const
|
---|
266 | </h3><p>Returns TRUE if the size grip is enabled; otherwise returns FALSE.
|
---|
267 | See the <a href="qdialog.html#sizeGripEnabled-prop">"sizeGripEnabled"</a> property for details.
|
---|
268 | <h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation"></a>QDialog::orientation () const
|
---|
269 | </h3>
|
---|
270 | Returns the dialog's extension orientation.
|
---|
271 | <p> <p>See also <a href="#setOrientation">setOrientation</a>().
|
---|
272 |
|
---|
273 | <h3 class=fn>void <a name="reject"></a>QDialog::reject ()<tt> [virtual protected slot]</tt>
|
---|
274 | </h3>
|
---|
275 | Hides the modal dialog and sets the result code to <a href="#DialogCode-enum">Rejected</a>.
|
---|
276 | <p> <p>See also <a href="#accept">accept</a>() and <a href="#done">done</a>().
|
---|
277 |
|
---|
278 | <h3 class=fn>int <a name="result"></a>QDialog::result () const
|
---|
279 | </h3>
|
---|
280 |
|
---|
281 | <p> Returns the modal dialog's result code, <a href="#DialogCode-enum">Accepted</a> or <a href="#DialogCode-enum">Rejected</a>.
|
---|
282 | <p> Do not call this function if the dialog was constructed with the <a href="qt.html#WidgetFlags-enum">WDestructiveClose</a> flag.
|
---|
283 |
|
---|
284 | <h3 class=fn>void <a name="setExtension"></a>QDialog::setExtension ( <a href="qwidget.html">QWidget</a> * extension )
|
---|
285 | </h3>
|
---|
286 | Sets the widget, <em>extension</em>, to be the dialog's extension,
|
---|
287 | deleting any previous extension. The dialog takes ownership of the
|
---|
288 | extension. Note that if 0 is passed any existing extension will be
|
---|
289 | deleted.
|
---|
290 | <p> This function must only be called while the dialog is hidden.
|
---|
291 | <p> <p>See also <a href="#showExtension">showExtension</a>(), <a href="#setOrientation">setOrientation</a>(), and <a href="#extension">extension</a>().
|
---|
292 |
|
---|
293 | <h3 class=fn>void <a name="setModal"></a>QDialog::setModal ( bool modal )
|
---|
294 | </h3><p>Sets whether <a href="#show">show</a>() should pop up the dialog as modal or modeless to <em>modal</em>.
|
---|
295 | See the <a href="qdialog.html#modal-prop">"modal"</a> property for details.
|
---|
296 | <h3 class=fn>void <a name="setOrientation"></a>QDialog::setOrientation ( <a href="qt.html#Orientation-enum">Orientation</a> orientation )
|
---|
297 | </h3>
|
---|
298 | If <em>orientation</em> is <a href="qt.html#Orientation-enum">Horizontal</a>, the extension will be displayed
|
---|
299 | to the right of the dialog's main area. If <em>orientation</em> is <a href="qt.html#Orientation-enum">Vertical</a>, the extension will be displayed below the dialog's main
|
---|
300 | area.
|
---|
301 | <p> <p>See also <a href="#orientation">orientation</a>() and <a href="#setExtension">setExtension</a>().
|
---|
302 |
|
---|
303 | <h3 class=fn>void <a name="setResult"></a>QDialog::setResult ( int i )<tt> [protected]</tt>
|
---|
304 | </h3>
|
---|
305 |
|
---|
306 | <p> Sets the modal dialog's result code to <em>i</em>.
|
---|
307 |
|
---|
308 | <h3 class=fn>void <a name="setSizeGripEnabled"></a>QDialog::setSizeGripEnabled ( bool )
|
---|
309 | </h3><p>Sets whether the size grip is enabled.
|
---|
310 | See the <a href="qdialog.html#sizeGripEnabled-prop">"sizeGripEnabled"</a> property for details.
|
---|
311 | <h3 class=fn>void <a name="show"></a>QDialog::show ()<tt> [virtual]</tt>
|
---|
312 | </h3>
|
---|
313 | Shows the dialog as a <a href="#modeless">modeless</a> dialog.
|
---|
314 | Control returns immediately to the calling code.
|
---|
315 | <p> The dialog will be modal or modeless according to the value
|
---|
316 | of the <a href="#modal-prop">modal</a> property.
|
---|
317 | <p> <p>See also <a href="#exec">exec</a>() and <a href="#modal-prop">modal</a>.
|
---|
318 |
|
---|
319 | <p>Examples: <a href="movies-example.html#x494">movies/main.cpp</a>, <a href="regexptester-example.html#x2511">regexptester/main.cpp</a>, <a href="showimg-example.html#x1317">showimg/showimg.cpp</a>, and <a href="sql.html#x2220">sql/overview/form1/main.cpp</a>.
|
---|
320 | <p>Reimplemented from <a href="qwidget.html#show">QWidget</a>.
|
---|
321 | <h3 class=fn>void <a name="showExtension"></a>QDialog::showExtension ( bool showIt )<tt> [protected slot]</tt>
|
---|
322 | </h3>
|
---|
323 | If <em>showIt</em> is TRUE, the dialog's extension is shown; otherwise the
|
---|
324 | extension is hidden.
|
---|
325 | <p> This slot is usually connected to the <a href="qbutton.html#toggled">QButton::toggled</a>() signal
|
---|
326 | of a <a href="qpushbutton.html">QPushButton</a>.
|
---|
327 | <p> A dialog with a visible extension is not resizeable.
|
---|
328 | <p> <p>See also <a href="#show">show</a>(), <a href="#setExtension">setExtension</a>(), and <a href="#setOrientation">setOrientation</a>().
|
---|
329 |
|
---|
330 | <hr><h2>Property Documentation</h2>
|
---|
331 | <h3 class=fn>bool <a name="modal-prop"></a>modal</h3> <p>This property holds whether <a href="#show">show</a>() should pop up the dialog as modal or modeless.
|
---|
332 | <p>By default, this property is false and show() pops up the dialog as
|
---|
333 | modeless.
|
---|
334 | <p> <a href="#exec">exec</a>() ignores the value of this property and always pops up the
|
---|
335 | dialog as modal.
|
---|
336 | <p> <p>See also <a href="#show">show</a>() and <a href="#exec">exec</a>().
|
---|
337 |
|
---|
338 | <p>Set this property's value with <a href="#setModal">setModal</a>() and get this property's value with <a href="#isModal">isModal</a>().
|
---|
339 | <h3 class=fn>bool <a name="sizeGripEnabled-prop"></a>sizeGripEnabled</h3>
|
---|
340 | <p>This property holds whether the size grip is enabled.
|
---|
341 | <p>A <a href="qsizegrip.html">QSizeGrip</a> is placed in the bottom right corner of the dialog when this
|
---|
342 | property is enabled. By default, the size grip is disabled.
|
---|
343 |
|
---|
344 | <p>Set this property's value with <a href="#setSizeGripEnabled">setSizeGripEnabled</a>() and get this property's value with <a href="#isSizeGripEnabled">isSizeGripEnabled</a>().
|
---|
345 | <!-- eof -->
|
---|
346 | <hr><p>
|
---|
347 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
348 | Copyright © 1995-2007
|
---|
349 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
350 | <table width=100% cellspacing=0 border=0><tr>
|
---|
351 | <td>Copyright © 2007
|
---|
352 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
353 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
354 | </table></div></address></body>
|
---|
355 | </html>
|
---|