File: qinputdialog.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 (153 lines) | stat: -rw-r--r-- 33,722 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
<?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>QInputDialog 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">QInputDialog Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QInputDialog class provides a simple convenience dialog to get a single value from the user. <a href="#details">More...</a></p>
<p>Inherits <a href="qdialog.html">QDialog</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qinputdialog.html#InputDialogOption-enum">InputDialogOption</a></b> { NoButtons, UseListViewForComboBoxItems }</li><li><div class="fn" />class <b><a href="qinputdialog-inputdialogoptions.html">InputDialogOptions</a></b></li><li><div class="fn" />enum <b><a href="qinputdialog.html#InputMode-enum">InputMode</a></b> { TextInput, IntInput, DoubleInput }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qinputdialog.html#QInputDialog">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None, Qt.WindowFlags&#160;<i>flags</i>&#160;=&#160;0)</li><li><div class="fn" />QString <b><a href="qinputdialog.html#cancelButtonText">cancelButtonText</a></b> (<i>self</i>)</li><li><div class="fn" />QStringList <b><a href="qinputdialog.html#comboBoxItems">comboBoxItems</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qinputdialog.html#done">done</a></b> (<i>self</i>, int)</li><li><div class="fn" />int <b><a href="qinputdialog.html#doubleDecimals">doubleDecimals</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qinputdialog.html#doubleMaximum">doubleMaximum</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qinputdialog.html#doubleMinimum">doubleMinimum</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qinputdialog.html#doubleValue">doubleValue</a></b> (<i>self</i>)</li><li><div class="fn" />InputMode <b><a href="qinputdialog.html#inputMode">inputMode</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qinputdialog.html#intMaximum">intMaximum</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qinputdialog.html#intMinimum">intMinimum</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qinputdialog.html#intStep">intStep</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qinputdialog.html#intValue">intValue</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qinputdialog.html#isComboBoxEditable">isComboBoxEditable</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qinputdialog.html#labelText">labelText</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qinputdialog.html#minimumSizeHint">minimumSizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qinputdialog.html#okButtonText">okButtonText</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qinputdialog.html#open">open</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qinputdialog.html#open-2">open</a></b> (<i>self</i>, QObject, SLOT()SLOT())</li><li><div class="fn" /><b><a href="qinputdialog.html#open-3">open</a></b> (<i>self</i>, callable)</li><li><div class="fn" />InputDialogOptions <b><a href="qinputdialog.html#options">options</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qinputdialog.html#setCancelButtonText">setCancelButtonText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qinputdialog.html#setComboBoxEditable">setComboBoxEditable</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qinputdialog.html#setComboBoxItems">setComboBoxItems</a></b> (<i>self</i>, QStringList)</li><li><div class="fn" /><b><a href="qinputdialog.html#setDoubleDecimals">setDoubleDecimals</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qinputdialog.html#setDoubleMaximum">setDoubleMaximum</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qinputdialog.html#setDoubleMinimum">setDoubleMinimum</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qinputdialog.html#setDoubleRange">setDoubleRange</a></b> (<i>self</i>, float, float)</li><li><div class="fn" /><b><a href="qinputdialog.html#setDoubleValue">setDoubleValue</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qinputdialog.html#setInputMode">setInputMode</a></b> (<i>self</i>, InputMode)</li><li><div class="fn" /><b><a href="qinputdialog.html#setIntMaximum">setIntMaximum</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qinputdialog.html#setIntMinimum">setIntMinimum</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qinputdialog.html#setIntRange">setIntRange</a></b> (<i>self</i>, int, int)</li><li><div class="fn" /><b><a href="qinputdialog.html#setIntStep">setIntStep</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qinputdialog.html#setIntValue">setIntValue</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qinputdialog.html#setLabelText">setLabelText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qinputdialog.html#setOkButtonText">setOkButtonText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qinputdialog.html#setOption">setOption</a></b> (<i>self</i>, InputDialogOption, bool&#160;<i>on</i>&#160;=&#160;True)</li><li><div class="fn" /><b><a href="qinputdialog.html#setOptions">setOptions</a></b> (<i>self</i>, InputDialogOptions)</li><li><div class="fn" /><b><a href="qinputdialog.html#setTextEchoMode">setTextEchoMode</a></b> (<i>self</i>, QLineEdit.EchoMode)</li><li><div class="fn" /><b><a href="qinputdialog.html#setTextValue">setTextValue</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qinputdialog.html#setVisible">setVisible</a></b> (<i>self</i>, bool)</li><li><div class="fn" />QSize <b><a href="qinputdialog.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qinputdialog.html#testOption">testOption</a></b> (<i>self</i>, InputDialogOption)</li><li><div class="fn" />QLineEdit.EchoMode <b><a href="qinputdialog.html#textEchoMode">textEchoMode</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qinputdialog.html#textValue">textValue</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />(float, bool&#160;<i>ok</i>) <b><a href="qinputdialog.html#getDouble">getDouble</a></b> (QWidget, QString, QString, float&#160;<i>value</i>&#160;=&#160;0, float&#160;<i>min</i>&#160;=&#160;-2147483647, float&#160;<i>max</i>&#160;=&#160;2147483647, int&#160;<i>decimals</i>&#160;=&#160;1, Qt.WindowFlags&#160;<i>flags</i>&#160;=&#160;0)</li><li><div class="fn" />(int, bool&#160;<i>ok</i>) <b><a href="qinputdialog.html#getInt">getInt</a></b> (QWidget, QString, QString, int&#160;<i>value</i>&#160;=&#160;0, int&#160;<i>min</i>&#160;=&#160;-2147483647, int&#160;<i>max</i>&#160;=&#160;2147483647, int&#160;<i>step</i>&#160;=&#160;1, Qt.WindowFlags&#160;<i>flags</i>&#160;=&#160;0)</li><li><div class="fn" />(int, bool&#160;<i>ok</i>) <b><a href="qinputdialog.html#getInteger">getInteger</a></b> (QWidget, QString, QString, int&#160;<i>value</i>&#160;=&#160;0, int&#160;<i>min</i>&#160;=&#160;-2147483647, int&#160;<i>max</i>&#160;=&#160;2147483647, int&#160;<i>step</i>&#160;=&#160;1, Qt.WindowFlags&#160;<i>flags</i>&#160;=&#160;0)</li><li><div class="fn" />(QString, bool&#160;<i>ok</i>) <b><a href="qinputdialog.html#getItem">getItem</a></b> (QWidget, QString, QString, QStringList, int&#160;<i>current</i>&#160;=&#160;0, bool&#160;<i>editable</i>&#160;=&#160;True, Qt.WindowFlags&#160;<i>flags</i>&#160;=&#160;0)</li><li><div class="fn" />(QString, bool&#160;<i>ok</i>) <b><a href="qinputdialog.html#getText">getText</a></b> (QWidget, QString, QString, QLineEdit.EchoMode&#160;<i>mode</i>&#160;=&#160;QLineEdit.Normal, QString&#160;<i>text</i>&#160;=&#160;QString(), Qt.WindowFlags&#160;<i>flags</i>&#160;=&#160;0)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qinputdialog.html#doubleValueChanged">doubleValueChanged</a></b> (double)</li><li><div class="fn" />void <b><a href="qinputdialog.html#doubleValueSelected">doubleValueSelected</a></b> (double)</li><li><div class="fn" />void <b><a href="qinputdialog.html#intValueChanged">intValueChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="qinputdialog.html#intValueSelected">intValueSelected</a></b> (int)</li><li><div class="fn" />void <b><a href="qinputdialog.html#textValueChanged">textValueChanged</a></b> (const QString&amp;)</li><li><div class="fn" />void <b><a href="qinputdialog.html#textValueSelected">textValueSelected</a></b> (const QString&amp;)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QInputDialog class provides a simple convenience dialog to get a single value from the user.</p>
<p>The input value can be a string, a number or an item from a list. A label must be set to tell the user what they should enter.</p>
<p>Four static convenience functions are provided: <a href="qinputdialog.html#getText">getText</a>(), <a href="qinputdialog.html#getInt">getInt</a>(), <a href="qinputdialog.html#getDouble">getDouble</a>(), and <a href="qinputdialog.html#getItem">getItem</a>(). All the functions can be used in a similar way, for example:</p>
<pre>     bool ok;
     QString text = QInputDialog.getText(this, tr("QInputDialog.getText()"),
                                          tr("User name:"), QLineEdit.Normal,
                                          QDir.home().dirName(), &amp;ok);
     if (ok &amp;&amp; !text.isEmpty())
         textLabel-&gt;setText(text);</pre>
<p>The <tt>ok</tt> variable is set to true if the user clicks <b>OK</b>; otherwise it is set to false.</p>
<p align="center"><img alt="Input Dialogs" src="images/inputdialogs.png" /></p><p>The <a href="dialogs-standarddialogs.html">Standard Dialogs</a> example shows how to use QInputDialog as well as other built-in Qt dialogs.</p>
<p>See also <a href="qmessagebox.html">QMessageBox</a> and <a href="dialogs-standarddialogs.html">Standard Dialogs Example</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="InputDialogOption-enum" />QInputDialog.InputDialogOption</h3><p>This enum specifies various options that affect the look and feel of an input dialog.</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>QInputDialog.NoButtons</tt></td><td align="center" valign="top"><tt>0x00000001</tt></td><td valign="top">Don't display <b>OK</b> and <b>Cancel</b> buttons. (Useful for "live dialogs".)</td></tr>
<tr><td valign="top"><tt>QInputDialog.UseListViewForComboBoxItems</tt></td><td align="center" valign="top"><tt>0x00000002</tt></td><td valign="top">Use a <a href="qlistview.html">QListView</a> rather than a non-editable <a href="qcombobox.html">QComboBox</a> for displaying the items set with <a href="qinputdialog.html#comboBoxItems-prop">setComboBoxItems</a>().</td></tr>
</table></p>
<p>This enum was introduced in Qt 4.5.</p>
<p>The InputDialogOptions type is a typedef for <a href="qflags.html">QFlags</a>&lt;InputDialogOption&gt;. It stores an OR combination of InputDialogOption values.</p>
<p>See also <a href="qinputdialog.html#options-prop">options</a>, <a href="qinputdialog.html#setOption">setOption</a>(), and <a href="qinputdialog.html#testOption">testOption</a>().</p>
<a name="//apple_ref/cpp/tag/QInputDialog/InputMode" />
<a name="//apple_ref/cpp/econst/QInputDialog/TextInput" />
<a name="//apple_ref/cpp/econst/QInputDialog/IntInput" />
<a name="//apple_ref/cpp/econst/QInputDialog/DoubleInput" />
<h3 class="fn"><a name="InputMode-enum" />QInputDialog.InputMode</h3><p>This enum describes the different modes of input that can be selected for the dialog.</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>QInputDialog.TextInput</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Used to input text strings.</td></tr>
<tr><td valign="top"><tt>QInputDialog.IntInput</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Used to input integers.</td></tr>
<tr><td valign="top"><tt>QInputDialog.DoubleInput</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Used to input floating point numbers with double precision accuracy.</td></tr>
</table></p>
<p>This enum was introduced in Qt 4.5.</p>
<p>See also <a href="qinputdialog.html#inputMode-prop">inputMode</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QInputDialog" />QInputDialog.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None, <a href="qt-windowflags.html">Qt.WindowFlags</a>&#160;<i>flags</i>&#160;=&#160;0)</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 new input dialog with the given <i>parent</i> and window <i>flags</i>.</p>
<p>This function was introduced in Qt 4.5.</p>
<a name="//apple_ref/cpp/instm/QInputDialog/~QInputDialog" />
<h3 class="fn"><a name="cancelButtonText" />QString QInputDialog.cancelButtonText (<i>self</i>)</h3><h3 class="fn"><a name="comboBoxItems" />QStringList QInputDialog.comboBoxItems (<i>self</i>)</h3><h3 class="fn"><a name="done" />QInputDialog.done (<i>self</i>, int)</h3><p>Reimplemented from <a href="qdialog.html#done">QDialog.done</a>().</p>
<p>Closes the dialog and sets its result code to <i>result</i>. If this dialog is shown with <a href="qdialog.html#exec">exec_</a>(), done() causes the local event loop to finish, and <a href="qdialog.html#exec">exec_</a>() to return <i>result</i>.</p>
<p>See also <a href="qdialog.html#done">QDialog.done</a>().</p>
<a name="//apple_ref/cpp/instm/QInputDialog/doubleValueChanged" />
<h3 class="fn"><a name="doubleDecimals" />int QInputDialog.doubleDecimals (<i>self</i>)</h3><h3 class="fn"><a name="doubleMaximum" />float QInputDialog.doubleMaximum (<i>self</i>)</h3><h3 class="fn"><a name="doubleMinimum" />float QInputDialog.doubleMinimum (<i>self</i>)</h3><h3 class="fn"><a name="doubleValue" />float QInputDialog.doubleValue (<i>self</i>)</h3><h3 class="fn"><a name="getDouble" />(float, bool&#160;<i>ok</i>) QInputDialog.getDouble (<a href="qwidget.html">QWidget</a>, QString, QString, float&#160;<i>value</i>&#160;=&#160;0, float&#160;<i>min</i>&#160;=&#160;-2147483647, float&#160;<i>max</i>&#160;=&#160;2147483647, int&#160;<i>decimals</i>&#160;=&#160;1, <a href="qt-windowflags.html">Qt.WindowFlags</a>&#160;<i>flags</i>&#160;=&#160;0)</h3><p>Static convenience function to get a floating point number from the user.</p>
<p><i>title</i> is the text which is displayed in the title bar of the dialog. <i>label</i> is the text which is shown to the user (it should say what should be entered). <i>value</i> is the default floating point number that the line edit will be set to. <i>min</i> and <i>max</i> are the minimum and maximum values the user may choose. <i>decimals</i> is the maximum number of decimal places the number may have.</p>
<p>If <i>ok</i> is nonnull, *<i>ok</i> will be set to true if the user pressed <b>OK</b> and to false if the user pressed <b>Cancel</b>. The dialog's parent is <i>parent</i>. The dialog will be modal and uses the widget <i>flags</i>.</p>
<p>This function returns the floating point number which has been entered by the user.</p>
<p>Use this static function like this:</p>
<pre>     bool ok;
     double d = QInputDialog.getDouble(this, tr("QInputDialog.getDouble()"),
                                        tr("Amount:"), 37.56, -10000, 10000, 2, &amp;ok);
     if (ok)
         doubleLabel-&gt;setText(QString("$%1").arg(d));</pre>
<p><b>Warning:</b> Do not delete <i>parent</i> during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the <a href="qinputdialog.html">QInputDialog</a> constructors.</p>
<p>See also <a href="qinputdialog.html#getText">getText</a>(), <a href="qinputdialog.html#getInt">getInt</a>(), and <a href="qinputdialog.html#getItem">getItem</a>().</p>
<a name="//apple_ref/cpp/clm/QInputDialog/getInt" />
<h3 class="fn"><a name="getInt" />(int, bool&#160;<i>ok</i>) QInputDialog.getInt (<a href="qwidget.html">QWidget</a>, QString, QString, int&#160;<i>value</i>&#160;=&#160;0, int&#160;<i>min</i>&#160;=&#160;-2147483647, int&#160;<i>max</i>&#160;=&#160;2147483647, int&#160;<i>step</i>&#160;=&#160;1, <a href="qt-windowflags.html">Qt.WindowFlags</a>&#160;<i>flags</i>&#160;=&#160;0)</h3><p>Static convenience function to get an integer input from the user.</p>
<p><i>title</i> is the text which is displayed in the title bar of the dialog. <i>label</i> is the text which is shown to the user (it should say what should be entered). <i>value</i> is the default integer which the spinbox will be set to. <i>min</i> and <i>max</i> are the minimum and maximum values the user may choose. <i>step</i> is the amount by which the values change as the user presses the arrow buttons to increment or decrement the value.</p>
<p>If <i>ok</i> is nonnull *<i>ok</i> will be set to true if the user pressed <b>OK</b> and to false if the user pressed <b>Cancel</b>. The dialog's parent is <i>parent</i>. The dialog will be modal and uses the widget <i>flags</i>.</p>
<p>On success, this function returns the integer which has been entered by the user; on failure, it returns the initial <i>value</i>.</p>
<p>Use this static function like this:</p>
<pre>     bool ok;
     int i = QInputDialog.getInt(this, tr("QInputDialog.getInteger()"),
                                  tr("Percentage:"), 25, 0, 100, 1, &amp;ok);
     if (ok)
         integerLabel-&gt;setText(tr("%1%").arg(i));</pre>
<p><b>Warning:</b> Do not delete <i>parent</i> during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the <a href="qinputdialog.html">QInputDialog</a> constructors.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qinputdialog.html#getText">getText</a>(), <a href="qinputdialog.html#getDouble">getDouble</a>(), and <a href="qinputdialog.html#getItem">getItem</a>().</p>
<a name="//apple_ref/cpp/clm/QInputDialog/getItem" />
<h3 class="fn"><a name="getInteger" />(int, bool&#160;<i>ok</i>) QInputDialog.getInteger (<a href="qwidget.html">QWidget</a>, QString, QString, int&#160;<i>value</i>&#160;=&#160;0, int&#160;<i>min</i>&#160;=&#160;-2147483647, int&#160;<i>max</i>&#160;=&#160;2147483647, int&#160;<i>step</i>&#160;=&#160;1, <a href="qt-windowflags.html">Qt.WindowFlags</a>&#160;<i>flags</i>&#160;=&#160;0)</h3><h3 class="fn"><a name="getItem" />(QString, bool&#160;<i>ok</i>) QInputDialog.getItem (<a href="qwidget.html">QWidget</a>, QString, QString, QStringList, int&#160;<i>current</i>&#160;=&#160;0, bool&#160;<i>editable</i>&#160;=&#160;True, <a href="qt-windowflags.html">Qt.WindowFlags</a>&#160;<i>flags</i>&#160;=&#160;0)</h3><p>Static convenience function to let the user select an item from a string list.</p>
<p><i>title</i> is the text which is displayed in the title bar of the dialog. <i>label</i> is the text which is shown to the user (it should say what should be entered). <i>items</i> is the string list which is inserted into the combobox. <i>current</i> is the number of the item which should be the current item.</p>
<p>If <i>editable</i> is true the user can enter their own text; otherwise the user may only select one of the existing items.</p>
<p>If <i>ok</i> is nonnull <i>*a</i> ok will be set to true if the user pressed <b>OK</b> and to false if the user pressed <b>Cancel</b>. The dialog's parent is <i>parent</i>. The dialog will be modal and uses the widget <i>flags</i>.</p>
<p>This function returns the text of the current item, or if <i>editable</i> is true, the current text of the combobox.</p>
<p>Use this static function like this:</p>
<pre>     QStringList items;
     items &lt;&lt; tr("Spring") &lt;&lt; tr("Summer") &lt;&lt; tr("Fall") &lt;&lt; tr("Winter");

     bool ok;
     QString item = QInputDialog.getItem(this, tr("QInputDialog.getItem()"),
                                          tr("Season:"), items, 0, false, &amp;ok);
     if (ok &amp;&amp; !item.isEmpty())
         itemLabel-&gt;setText(item);</pre>
<p><b>Warning:</b> Do not delete <i>parent</i> during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the <a href="qinputdialog.html">QInputDialog</a> constructors.</p>
<p>See also <a href="qinputdialog.html#getText">getText</a>(), <a href="qinputdialog.html#getInt">getInt</a>(), and <a href="qinputdialog.html#getDouble">getDouble</a>().</p>
<a name="//apple_ref/cpp/clm/QInputDialog/getText" />
<h3 class="fn"><a name="getText" />(QString, bool&#160;<i>ok</i>) QInputDialog.getText (<a href="qwidget.html">QWidget</a>, QString, QString, <a href="qlineedit.html#EchoMode-enum">QLineEdit.EchoMode</a>&#160;<i>mode</i>&#160;=&#160;QLineEdit.Normal, QString&#160;<i>text</i>&#160;=&#160;QString(), <a href="qt-windowflags.html">Qt.WindowFlags</a>&#160;<i>flags</i>&#160;=&#160;0)</h3><p>Static convenience function to get a string from the user.</p>
<p><i>title</i> is the text which is displayed in the title bar of the dialog. <i>label</i> is the text which is shown to the user (it should say what should be entered). <i>text</i> is the default text which is placed in the line edit. <i>mode</i> is the echo mode the line edit will use.</p>
<p>If <i>ok</i> is nonnull <i>*a</i> ok will be set to true if the user pressed <b>OK</b> and to false if the user pressed <b>Cancel</b>. The dialog's parent is <i>parent</i>. The dialog will be modal and uses the specified widget <i>flags</i>.</p>
<p>If the dialog is accepted, this function returns the text in the dialog's line edit. If the dialog is rejected, a null <a href="qstring.html">QString</a> is returned.</p>
<p>Use this static function like this:</p>
<pre>     bool ok;
     QString text = QInputDialog.getText(this, tr("QInputDialog.getText()"),
                                          tr("User name:"), QLineEdit.Normal,
                                          QDir.home().dirName(), &amp;ok);
     if (ok &amp;&amp; !text.isEmpty())
         textLabel-&gt;setText(text);</pre>
<p><b>Warning:</b> Do not delete <i>parent</i> during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the <a href="qinputdialog.html">QInputDialog</a> constructors.</p>
<p>See also <a href="qinputdialog.html#getInt">getInt</a>(), <a href="qinputdialog.html#getDouble">getDouble</a>(), and <a href="qinputdialog.html#getItem">getItem</a>().</p>
<a name="//apple_ref/cpp/instm/QInputDialog/intValueChanged" />
<h3 class="fn"><a name="inputMode" /><a href="qinputdialog.html#InputMode-enum">InputMode</a> QInputDialog.inputMode (<i>self</i>)</h3><h3 class="fn"><a name="intMaximum" />int QInputDialog.intMaximum (<i>self</i>)</h3><h3 class="fn"><a name="intMinimum" />int QInputDialog.intMinimum (<i>self</i>)</h3><h3 class="fn"><a name="intStep" />int QInputDialog.intStep (<i>self</i>)</h3><h3 class="fn"><a name="intValue" />int QInputDialog.intValue (<i>self</i>)</h3><h3 class="fn"><a name="isComboBoxEditable" />bool QInputDialog.isComboBoxEditable (<i>self</i>)</h3><h3 class="fn"><a name="labelText" />QString QInputDialog.labelText (<i>self</i>)</h3><h3 class="fn"><a name="minimumSizeHint" /><a href="qsize.html">QSize</a> QInputDialog.minimumSizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget.minimumSizeHint</a>().</p>
<a name="//apple_ref/cpp/instm/QInputDialog/open" />
<h3 class="fn"><a name="okButtonText" />QString QInputDialog.okButtonText (<i>self</i>)</h3><h3 class="fn"><a name="open" />QInputDialog.open (<i>self</i>)</h3><p>This is an overloaded function.</p>
<p>This function connects one of its signals to the slot specified by <i>receiver</i> and <i>member</i>. The specific signal depends on the arguments that are specified in <i>member</i>. These are:</p>
<ul>
<li><a href="qinputdialog.html#textValueSelected">textValueSelected</a>() if <i>member</i> has a <a href="qstring.html">QString</a> for its first argument.</li>
<li><a href="qinputdialog.html#intValueSelected">intValueSelected</a>() if <i>member</i> has an int for its first argument.</li>
<li><a href="qinputdialog.html#doubleValueSelected">doubleValueSelected</a>() if <i>member</i> has a double for its first argument.</li>
<li><a href="qdialog.html#accepted">accepted</a>() if <i>member</i> has NO arguments.</li>
</ul>
<p>The signal will be disconnected from the slot when the dialog is closed.</p>
<p>This function was introduced in Qt 4.5.</p>
<a name="//apple_ref/cpp/instm/QInputDialog/setDoubleRange" />
<h3 class="fn"><a name="open-2" />QInputDialog.open (<i>self</i>, <a href="qobject.html">QObject</a>, SLOT()SLOT())</h3><h3 class="fn"><a name="open-3" />QInputDialog.open (<i>self</i>, callable)</h3><h3 class="fn"><a name="options" /><a href="qinputdialog-inputdialogoptions.html">InputDialogOptions</a> QInputDialog.options (<i>self</i>)</h3><h3 class="fn"><a name="setCancelButtonText" />QInputDialog.setCancelButtonText (<i>self</i>, QString)</h3><h3 class="fn"><a name="setComboBoxEditable" />QInputDialog.setComboBoxEditable (<i>self</i>, bool)</h3><h3 class="fn"><a name="setComboBoxItems" />QInputDialog.setComboBoxItems (<i>self</i>, QStringList)</h3><h3 class="fn"><a name="setDoubleDecimals" />QInputDialog.setDoubleDecimals (<i>self</i>, int)</h3><h3 class="fn"><a name="setDoubleMaximum" />QInputDialog.setDoubleMaximum (<i>self</i>, float)</h3><h3 class="fn"><a name="setDoubleMinimum" />QInputDialog.setDoubleMinimum (<i>self</i>, float)</h3><h3 class="fn"><a name="setDoubleRange" />QInputDialog.setDoubleRange (<i>self</i>, float, float)</h3><p>Sets the range of double precision floating point values accepted by the dialog when used in <a href="qinputdialog.html#InputMode-enum">DoubleInput</a> mode, with minimum and maximum values specified by <i>min</i> and <i>max</i> respectively.</p>
<a name="//apple_ref/cpp/instm/QInputDialog/setIntRange" />
<h3 class="fn"><a name="setDoubleValue" />QInputDialog.setDoubleValue (<i>self</i>, float)</h3><h3 class="fn"><a name="setInputMode" />QInputDialog.setInputMode (<i>self</i>, <a href="qinputdialog.html#InputMode-enum">InputMode</a>)</h3><h3 class="fn"><a name="setIntMaximum" />QInputDialog.setIntMaximum (<i>self</i>, int)</h3><h3 class="fn"><a name="setIntMinimum" />QInputDialog.setIntMinimum (<i>self</i>, int)</h3><h3 class="fn"><a name="setIntRange" />QInputDialog.setIntRange (<i>self</i>, int, int)</h3><p>Sets the range of integer values accepted by the dialog when used in <a href="qinputdialog.html#InputMode-enum">IntInput</a> mode, with minimum and maximum values specified by <i>min</i> and <i>max</i> respectively.</p>
<a name="//apple_ref/cpp/instm/QInputDialog/setOption" />
<h3 class="fn"><a name="setIntStep" />QInputDialog.setIntStep (<i>self</i>, int)</h3><h3 class="fn"><a name="setIntValue" />QInputDialog.setIntValue (<i>self</i>, int)</h3><h3 class="fn"><a name="setLabelText" />QInputDialog.setLabelText (<i>self</i>, QString)</h3><h3 class="fn"><a name="setOkButtonText" />QInputDialog.setOkButtonText (<i>self</i>, QString)</h3><h3 class="fn"><a name="setOption" />QInputDialog.setOption (<i>self</i>, <a href="qinputdialog.html#InputDialogOption-enum">InputDialogOption</a>, bool&#160;<i>on</i>&#160;=&#160;True)</h3><p>Sets the given <i>option</i> to be enabled if <i>on</i> is true; otherwise, clears the given <i>option</i>.</p>
<p>See also <a href="qinputdialog.html#options-prop">options</a> and <a href="qinputdialog.html#testOption">testOption</a>().</p>
<a name="//apple_ref/cpp/instm/QInputDialog/setVisible" />
<h3 class="fn"><a name="setOptions" />QInputDialog.setOptions (<i>self</i>, <a href="qinputdialog-inputdialogoptions.html">InputDialogOptions</a>)</h3><h3 class="fn"><a name="setTextEchoMode" />QInputDialog.setTextEchoMode (<i>self</i>, <a href="qlineedit.html#EchoMode-enum">QLineEdit.EchoMode</a>)</h3><h3 class="fn"><a name="setTextValue" />QInputDialog.setTextValue (<i>self</i>, QString)</h3><h3 class="fn"><a name="setVisible" />QInputDialog.setVisible (<i>self</i>, bool)</h3><p>Reimplemented from <a href="qwidget.html#visible-prop">QWidget.setVisible</a>().</p>
<a name="//apple_ref/cpp/instm/QInputDialog/sizeHint" />
<h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QInputDialog.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p>
<a name="//apple_ref/cpp/instm/QInputDialog/testOption" />
<h3 class="fn"><a name="testOption" />bool QInputDialog.testOption (<i>self</i>, <a href="qinputdialog.html#InputDialogOption-enum">InputDialogOption</a>)</h3><p>Returns true if the given <i>option</i> is enabled; otherwise, returns false.</p>
<p>See also <a href="qinputdialog.html#options-prop">options</a> and <a href="qinputdialog.html#setOption">setOption</a>().</p>
<a name="//apple_ref/cpp/instm/QInputDialog/textValueChanged" />
<h3 class="fn"><a name="textEchoMode" /><a href="qlineedit.html#EchoMode-enum">QLineEdit.EchoMode</a> QInputDialog.textEchoMode (<i>self</i>)</h3><h3 class="fn"><a name="textValue" />QString QInputDialog.textValue (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="doubleValueChanged" />void doubleValueChanged (double)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the double value changes in the dialog. The current value is specified by <i>value</i>.</p>
<p>This signal is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">DoubleInput</a> mode.</p>
<a name="//apple_ref/cpp/instm/QInputDialog/doubleValueSelected" />
<h3 class="fn"><a name="doubleValueSelected" />void doubleValueSelected (double)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the user selects a double value by accepting the dialog; for example, by clicking the <b>OK</b> button. The selected value is specified by <i>value</i>.</p>
<p>This signal is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">DoubleInput</a> mode.</p>
<a name="//apple_ref/cpp/clm/QInputDialog/getDouble" />
<h3 class="fn"><a name="intValueChanged" />void intValueChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the integer value changes in the dialog. The current value is specified by <i>value</i>.</p>
<p>This signal is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">IntInput</a> mode.</p>
<a name="//apple_ref/cpp/instm/QInputDialog/intValueSelected" />
<h3 class="fn"><a name="intValueSelected" />void intValueSelected (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the user selects a integer value by accepting the dialog; for example, by clicking the <b>OK</b> button. The selected value is specified by <i>value</i>.</p>
<p>This signal is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">IntInput</a> mode.</p>
<a name="//apple_ref/cpp/instm/QInputDialog/minimumSizeHint" />
<h3 class="fn"><a name="textValueChanged" />void textValueChanged (const QString&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the text string changes in the dialog. The current string is specified by <i>text</i>.</p>
<p>This signal is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">TextInput</a> mode.</p>
<a name="//apple_ref/cpp/instm/QInputDialog/textValueSelected" />
<h3 class="fn"><a name="textValueSelected" />void textValueSelected (const QString&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the user selects a text string by accepting the dialog; for example, by clicking the <b>OK</b> button. The selected string is specified by <i>text</i>.</p>
<p>This signal is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">TextInput</a> mode.</p>
<p /><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>