<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qinputdialog.cpp --> <title>QInputDialog Class | Qt Widgets 5.12.6</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QInputDialog</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-types">Public Types</a></li> <li class="level1"><a href="#properties">Properties</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li> <li class="level1"><a href="#signals">Signals</a></li> <li class="level1"><a href="#static-public-members">Static Public Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">QInputDialog Class</h1> <!-- $$$QInputDialog-brief --> <p>The <a href="qinputdialog.html">QInputDialog</a> class provides a simple convenience dialog to get a single value from the user. <a href="#details">More...</a></p> <!-- @@@QInputDialog --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QInputDialog></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qdialog.html">QDialog</a></td></tr></table></div><ul> <li><a href="qinputdialog-members.html">List of all members, including inherited members</a></li> <li><a href="qinputdialog-obsolete.html">Obsolete members</a></li> </ul> <a name="public-types"></a> <h2 id="public-types">Public Types</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#InputDialogOption-enum">InputDialogOption</a></b> { NoButtons, UseListViewForComboBoxItems, UsePlainTextEditForTextInput }</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#InputDialogOption-enum">InputDialogOptions</a></b></td></tr> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#InputMode-enum">InputMode</a></b> { TextInput, IntInput, DoubleInput }</td></tr> </table></div> <a name="properties"></a> <h2 id="properties">Properties</h2> <div class="table"><table class="propsummary"> <tr><td class="topAlign"><ul> <li class="fn"><b><a href="qinputdialog.html#cancelButtonText-prop">cancelButtonText</a></b> : QString</li> <li class="fn"><b><a href="qinputdialog.html#comboBoxEditable-prop">comboBoxEditable</a></b> : bool</li> <li class="fn"><b><a href="qinputdialog.html#comboBoxItems-prop">comboBoxItems</a></b> : QStringList</li> <li class="fn"><b><a href="qinputdialog.html#doubleDecimals-prop">doubleDecimals</a></b> : int</li> <li class="fn"><b><a href="qinputdialog.html#doubleMaximum-prop">doubleMaximum</a></b> : double</li> <li class="fn"><b><a href="qinputdialog.html#doubleMinimum-prop">doubleMinimum</a></b> : double</li> <li class="fn"><b><a href="qinputdialog.html#doubleStep-prop">doubleStep</a></b> : double</li> <li class="fn"><b><a href="qinputdialog.html#doubleValue-prop">doubleValue</a></b> : int</li> <li class="fn"><b><a href="qinputdialog.html#inputMode-prop">inputMode</a></b> : InputMode</li> </ul></td><td class="topAlign"><ul> <li class="fn"><b><a href="qinputdialog.html#intMaximum-prop">intMaximum</a></b> : int</li> <li class="fn"><b><a href="qinputdialog.html#intMinimum-prop">intMinimum</a></b> : int</li> <li class="fn"><b><a href="qinputdialog.html#intStep-prop">intStep</a></b> : int</li> <li class="fn"><b><a href="qinputdialog.html#intValue-prop">intValue</a></b> : int</li> <li class="fn"><b><a href="qinputdialog.html#labelText-prop">labelText</a></b> : QString</li> <li class="fn"><b><a href="qinputdialog.html#okButtonText-prop">okButtonText</a></b> : QString</li> <li class="fn"><b><a href="qinputdialog.html#options-prop">options</a></b> : InputDialogOptions</li> <li class="fn"><b><a href="qinputdialog.html#textEchoMode-prop">textEchoMode</a></b> : QLineEdit::EchoMode</li> <li class="fn"><b><a href="qinputdialog.html#textValue-prop">textValue</a></b> : QString</li> </ul> </td></tr> </table></div> <ul> <li class="fn">2 properties inherited from <a href="qdialog.html#properties">QDialog</a></li> <li class="fn">59 properties inherited from <a href="qwidget.html#properties">QWidget</a></li> <li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li> </ul> <a name="public-functions"></a> <h2 id="public-functions">Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#QInputDialog">QInputDialog</a></b>(QWidget *<i>parent</i> = nullptr, Qt::WindowFlags <i>flags</i> = ...)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#dtor.QInputDialog">~QInputDialog</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#cancelButtonText-prop">cancelButtonText</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#comboBoxItems-prop">comboBoxItems</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleDecimals-prop">doubleDecimals</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> double </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleMaximum-prop">doubleMaximum</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> double </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleMinimum-prop">doubleMinimum</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> double </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleStep-prop">doubleStep</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> double </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleValue-prop">doubleValue</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QInputDialog::InputMode </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#inputMode-prop">inputMode</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#intMaximum-prop">intMaximum</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#intMinimum-prop">intMinimum</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#intStep-prop">intStep</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#intValue-prop">intValue</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#comboBoxEditable-prop">isComboBoxEditable</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#labelText-prop">labelText</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#okButtonText-prop">okButtonText</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#open">open</a></b>(QObject *<i>receiver</i>, const char *<i>member</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QInputDialog::InputDialogOptions </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#options-prop">options</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#cancelButtonText-prop">setCancelButtonText</a></b>(const QString &<i>text</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#comboBoxEditable-prop">setComboBoxEditable</a></b>(bool <i>editable</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#comboBoxItems-prop">setComboBoxItems</a></b>(const QStringList &<i>items</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleDecimals-prop">setDoubleDecimals</a></b>(int <i>decimals</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleMaximum-prop">setDoubleMaximum</a></b>(double <i>max</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleMinimum-prop">setDoubleMinimum</a></b>(double <i>min</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#setDoubleRange">setDoubleRange</a></b>(double <i>min</i>, double <i>max</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleStep-prop">setDoubleStep</a></b>(double <i>step</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleValue-prop">setDoubleValue</a></b>(double <i>value</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#inputMode-prop">setInputMode</a></b>(QInputDialog::InputMode <i>mode</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#intMaximum-prop">setIntMaximum</a></b>(int <i>max</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#intMinimum-prop">setIntMinimum</a></b>(int <i>min</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#setIntRange">setIntRange</a></b>(int <i>min</i>, int <i>max</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#intStep-prop">setIntStep</a></b>(int <i>step</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#intValue-prop">setIntValue</a></b>(int <i>value</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#labelText-prop">setLabelText</a></b>(const QString &<i>text</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#okButtonText-prop">setOkButtonText</a></b>(const QString &<i>text</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#setOption">setOption</a></b>(QInputDialog::InputDialogOption <i>option</i>, bool <i>on</i> = true)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#options-prop">setOptions</a></b>(QInputDialog::InputDialogOptions <i>options</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#textEchoMode-prop">setTextEchoMode</a></b>(QLineEdit::EchoMode <i>mode</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#textValue-prop">setTextValue</a></b>(const QString &<i>text</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#testOption">testOption</a></b>(QInputDialog::InputDialogOption <i>option</i>) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QLineEdit::EchoMode </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#textEchoMode-prop">textEchoMode</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#textValue-prop">textValue</a></b>() const</td></tr> </table></div> <a name="reimplemented-public-functions"></a> <h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#done">done</a></b>(int <i>result</i>) override</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#minimumSizeHint">minimumSizeHint</a></b>() const override</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#setVisible">setVisible</a></b>(bool <i>visible</i>) override</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#sizeHint">sizeHint</a></b>() const override</td></tr> </table></div> <ul> <li class="fn">8 public functions inherited from <a href="qdialog.html#public-functions">QDialog</a></li> <li class="fn">214 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li> <li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li> <li class="fn">14 public functions inherited from <a href="../qtgui/qpaintdevice.html#public-functions">QPaintDevice</a></li> </ul> <a name="signals"></a> <h2 id="signals">Signals</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleValueChanged">doubleValueChanged</a></b>(double <i>value</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#doubleValueSelected">doubleValueSelected</a></b>(double <i>value</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#intValueChanged">intValueChanged</a></b>(int <i>value</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#intValueSelected">intValueSelected</a></b>(int <i>value</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#textValueChanged">textValueChanged</a></b>(const QString &<i>text</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#textValueSelected">textValueSelected</a></b>(const QString &<i>text</i>)</td></tr> </table></div> <ul> <li class="fn">3 signals inherited from <a href="qdialog.html#signals">QDialog</a></li> <li class="fn">3 signals inherited from <a href="qwidget.html#signals">QWidget</a></li> <li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li> </ul> <a name="static-public-members"></a> <h2 id="static-public-members">Static Public Members</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> double </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#getDouble">getDouble</a></b>(QWidget *<i>parent</i>, const QString &<i>title</i>, const QString &<i>label</i>, double <i>value</i> = 0, double <i>min</i> = -2147483647, double <i>max</i> = 2147483647, int <i>decimals</i> = 1, bool *<i>ok</i> = nullptr, Qt::WindowFlags <i>flags</i> = ...)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> double </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#getDouble-1">getDouble</a></b>(QWidget *<i>parent</i>, const QString &<i>title</i>, const QString &<i>label</i>, double <i>value</i>, double <i>min</i>, double <i>max</i>, int <i>decimals</i>, bool *<i>ok</i>, Qt::WindowFlags <i>flags</i>, double <i>step</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#getInt">getInt</a></b>(QWidget *<i>parent</i>, const QString &<i>title</i>, const QString &<i>label</i>, int <i>value</i> = 0, int <i>min</i> = -2147483647, int <i>max</i> = 2147483647, int <i>step</i> = 1, bool *<i>ok</i> = nullptr, Qt::WindowFlags <i>flags</i> = ...)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#getItem">getItem</a></b>(QWidget *<i>parent</i>, const QString &<i>title</i>, const QString &<i>label</i>, const QStringList &<i>items</i>, int <i>current</i> = 0, bool <i>editable</i> = true, bool *<i>ok</i> = nullptr, Qt::WindowFlags <i>flags</i> = ..., Qt::InputMethodHints <i>inputMethodHints</i> = Qt::ImhNone)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#getMultiLineText">getMultiLineText</a></b>(QWidget *<i>parent</i>, const QString &<i>title</i>, const QString &<i>label</i>, const QString &<i>text</i> = QString(), bool *<i>ok</i> = nullptr, Qt::WindowFlags <i>flags</i> = ..., Qt::InputMethodHints <i>inputMethodHints</i> = Qt::ImhNone)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#getText">getText</a></b>(QWidget *<i>parent</i>, const QString &<i>title</i>, const QString &<i>label</i>, QLineEdit::EchoMode <i>mode</i> = QLineEdit::Normal, const QString &<i>text</i> = QString(), bool *<i>ok</i> = nullptr, Qt::WindowFlags <i>flags</i> = ..., Qt::InputMethodHints <i>inputMethodHints</i> = Qt::ImhNone)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qinputdialog.html#staticMetaObject-var">staticMetaObject</a></b></td></tr> </table></div> <ul> <li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li> <li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li class="fn">5 public slots inherited from <a href="qdialog.html#public-slots">QDialog</a></li> <li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li> <li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li> <li class="fn">6 protected functions inherited from <a href="qdialog.html#protected-functions">QDialog</a></li> <li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li> <li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li> <li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li> <li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li> </ul> <a name="details"></a> <!-- $$$QInputDialog-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qinputdialog.html">QInputDialog</a> 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>Five static convenience functions are provided: <a href="qinputdialog.html#getText">getText</a>(), <a href="qinputdialog.html#getMultiLineText">getMultiLineText</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 class="cpp"> bool ok; <span class="type"><a href="../qtcore/qstring.html">QString</a></span> text <span class="operator">=</span> <span class="type"><a href="qinputdialog.html#QInputDialog">QInputDialog</a></span><span class="operator">::</span>getText(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">"QInputDialog::getText()"</span>)<span class="operator">,</span> tr(<span class="string">"User name:"</span>)<span class="operator">,</span> <span class="type"><a href="qlineedit.html">QLineEdit</a></span><span class="operator">::</span>Normal<span class="operator">,</span> <span class="type"><a href="../qtcore/qdir.html">QDir</a></span><span class="operator">::</span>home()<span class="operator">.</span>dirName()<span class="operator">,</span> <span class="operator">&</span>ok); <span class="keyword">if</span> (ok <span class="operator">&</span><span class="operator">&</span> <span class="operator">!</span>text<span class="operator">.</span>isEmpty()) textLabel<span class="operator">-</span><span class="operator">></span>setText(text); </pre> <p>The <code>ok</code> variable is set to true if the user clicks <b>OK</b>; otherwise, it is set to false.</p> <p class="centerAlign"><img src="images/inputdialogs.png" alt="Input Dialogs" /></p><p>The <a href="qtwidgets-dialogs-standarddialogs-example.html">Standard Dialogs</a> example shows how to use <a href="qinputdialog.html">QInputDialog</a> as well as other built-in Qt dialogs.</p> </div> <p><b>See also </b><a href="qmessagebox.html">QMessageBox</a> and <a href="qtwidgets-dialogs-standarddialogs-example.html">Standard Dialogs Example</a>.</p> <!-- @@@QInputDialog --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$InputDialogOption$$$NoButtons$$$UseListViewForComboBoxItems$$$UsePlainTextEditForTextInput --> <h3 class="flags" id="InputDialogOption-enum"><a name="InputDialogOption-enum"></a>enum QInputDialog::<span class="name">InputDialogOption</span><br/>flags QInputDialog::<span class="name">InputDialogOptions</span></h3> <p>This enum specifies various options that affect the look and feel of an input dialog.</p> <div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><code>QInputDialog::NoButtons</code></td><td class="topAlign tblval"><code>0x00000001</code></td><td class="topAlign">Don't display <b>OK</b> and <b>Cancel</b> buttons (useful for "live dialogs").</td></tr> <tr><td class="topAlign"><code>QInputDialog::UseListViewForComboBoxItems</code></td><td class="topAlign tblval"><code>0x00000002</code></td><td class="topAlign">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> <tr><td class="topAlign"><code>QInputDialog::UsePlainTextEditForTextInput</code></td><td class="topAlign tblval"><code>0x00000004</code></td><td class="topAlign">Use a <a href="qplaintextedit.html">QPlainTextEdit</a> for multiline text input. This value was introduced in 5.2.</td></tr> </table></div> <p>This enum was introduced or modified in Qt 4.5.</p> <p>The InputDialogOptions type is a typedef for <a href="../qtcore/qflags.html">QFlags</a><InputDialogOption>. It stores an OR combination of InputDialogOption values.</p> <p><b>See also </b><a href="qtwidgets-cmake-qt5-wrap-ui.html#options">options</a>, <a href="qinputdialog.html#setOption">setOption</a>(), and <a href="qinputdialog.html#testOption">testOption</a>().</p> <!-- @@@InputDialogOption --> <!-- $$$InputMode$$$TextInput$$$IntInput$$$DoubleInput --> <h3 class="fn" id="InputMode-enum"><a name="InputMode-enum"></a>enum QInputDialog::<span class="name">InputMode</span></h3> <p>This enum describes the different modes of input that can be selected for the dialog.</p> <div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><code>QInputDialog::TextInput</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Used to input text strings.</td></tr> <tr><td class="topAlign"><code>QInputDialog::IntInput</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Used to input integers.</td></tr> <tr><td class="topAlign"><code>QInputDialog::DoubleInput</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Used to input floating point numbers with double precision accuracy.</td></tr> </table></div> <p>This enum was introduced or modified in Qt 4.5.</p> <p><b>See also </b><a href="qinputdialog.html#inputMode-prop">inputMode</a>.</p> <!-- @@@InputMode --> </div> <div class="prop"> <h2>Property Documentation</h2> <!-- $$$cancelButtonText-prop$$$cancelButtonText$$$setCancelButtonTextconstQString& --> <h3 class="fn" id="cancelButtonText-prop"><a name="cancelButtonText-prop"></a><span class="name">cancelButtonText</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3> <p>This property holds the text for the button used to cancel the dialog</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>cancelButtonText</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCancelButtonText</b></span>(const QString &<i>text</i>)</td></tr> </table></div> <!-- @@@cancelButtonText --> <!-- $$$comboBoxEditable-prop$$$isComboBoxEditable$$$setComboBoxEditablebool --> <h3 class="fn" id="comboBoxEditable-prop"><a name="comboBoxEditable-prop"></a><span class="name">comboBoxEditable</span> : <span class="type">bool</span></h3> <p>This property holds whether or not the combo box used in the input dialog is editable</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isComboBoxEditable</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setComboBoxEditable</b></span>(bool <i>editable</i>)</td></tr> </table></div> <!-- @@@comboBoxEditable --> <!-- $$$comboBoxItems-prop$$$comboBoxItems$$$setComboBoxItemsconstQStringList& --> <h3 class="fn" id="comboBoxItems-prop"><a name="comboBoxItems-prop"></a><span class="name">comboBoxItems</span> : <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span></h3> <p>This property holds the items used in the combo box for the input dialog</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QStringList </td><td class="memItemRight bottomAlign"><span class="name"><b>comboBoxItems</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setComboBoxItems</b></span>(const QStringList &<i>items</i>)</td></tr> </table></div> <!-- @@@comboBoxItems --> <!-- $$$doubleDecimals-prop$$$doubleDecimals$$$setDoubleDecimalsint --> <h3 class="fn" id="doubleDecimals-prop"><a name="doubleDecimals-prop"></a><span class="name">doubleDecimals</span> : <span class="type">int</span></h3> <p>sets the precision of the double spinbox in decimals</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>doubleDecimals</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDoubleDecimals</b></span>(int <i>decimals</i>)</td></tr> </table></div> <p><b>See also </b><a href="qdoublespinbox.html#decimals-prop">QDoubleSpinBox::setDecimals</a>().</p> <!-- @@@doubleDecimals --> <!-- $$$doubleMaximum-prop$$$doubleMaximum$$$setDoubleMaximumdouble --> <h3 class="fn" id="doubleMaximum-prop"><a name="doubleMaximum-prop"></a><span class="name">doubleMaximum</span> : <span class="type">double</span></h3> <p>This property holds the maximum double precision floating point value accepted as input</p> <p>This property is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">DoubleInput</a> mode.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> double </td><td class="memItemRight bottomAlign"><span class="name"><b>doubleMaximum</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDoubleMaximum</b></span>(double <i>max</i>)</td></tr> </table></div> <!-- @@@doubleMaximum --> <!-- $$$doubleMinimum-prop$$$doubleMinimum$$$setDoubleMinimumdouble --> <h3 class="fn" id="doubleMinimum-prop"><a name="doubleMinimum-prop"></a><span class="name">doubleMinimum</span> : <span class="type">double</span></h3> <p>This property holds the minimum double precision floating point value accepted as input</p> <p>This property is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">DoubleInput</a> mode.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> double </td><td class="memItemRight bottomAlign"><span class="name"><b>doubleMinimum</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDoubleMinimum</b></span>(double <i>min</i>)</td></tr> </table></div> <!-- @@@doubleMinimum --> <!-- $$$doubleStep-prop$$$doubleStep$$$setDoubleStepdouble --> <h3 class="fn" id="doubleStep-prop"><a name="doubleStep-prop"></a><span class="name">doubleStep</span> : <span class="type">double</span></h3> <p>This property holds the step by which the double value is increased and decreased</p> <p>This property is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">DoubleInput</a> mode.</p> <p>This property was introduced in Qt 5.10.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> double </td><td class="memItemRight bottomAlign"><span class="name"><b>doubleStep</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDoubleStep</b></span>(double <i>step</i>)</td></tr> </table></div> <!-- @@@doubleStep --> <!-- $$$doubleValue-prop$$$doubleValue$$$setDoubleValuedouble$$$doubleValueChangeddouble --> <h3 class="fn" id="doubleValue-prop"><a name="doubleValue-prop"></a><span class="name">doubleValue</span> : <span class="type">int</span></h3> <p>This property holds the current double precision floating point value accepted as input</p> <p>This property is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">DoubleInput</a> mode.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> double </td><td class="memItemRight bottomAlign"><span class="name"><b>doubleValue</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDoubleValue</b></span>(double <i>value</i>)</td></tr> </table></div> <p><b>Notifier signal:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qinputdialog.html#doubleValueChanged">doubleValueChanged</a></b></span>(double <i>value</i>)</td></tr> </table></div> <!-- @@@doubleValue --> <!-- $$$inputMode-prop$$$inputMode$$$setInputModeQInputDialog::InputMode --> <h3 class="fn" id="inputMode-prop"><a name="inputMode-prop"></a><span class="name">inputMode</span> : <span class="type"><a href="qinputdialog.html#InputMode-enum">InputMode</a></span></h3> <p>This property holds the mode used for input</p> <p>This property helps determine which widget is used for entering input into the dialog.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QInputDialog::InputMode </td><td class="memItemRight bottomAlign"><span class="name"><b>inputMode</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setInputMode</b></span>(QInputDialog::InputMode <i>mode</i>)</td></tr> </table></div> <!-- @@@inputMode --> <!-- $$$intMaximum-prop$$$intMaximum$$$setIntMaximumint --> <h3 class="fn" id="intMaximum-prop"><a name="intMaximum-prop"></a><span class="name">intMaximum</span> : <span class="type">int</span></h3> <p>This property holds the maximum integer value accepted as input</p> <p>This property is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">IntInput</a> mode.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>intMaximum</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIntMaximum</b></span>(int <i>max</i>)</td></tr> </table></div> <!-- @@@intMaximum --> <!-- $$$intMinimum-prop$$$intMinimum$$$setIntMinimumint --> <h3 class="fn" id="intMinimum-prop"><a name="intMinimum-prop"></a><span class="name">intMinimum</span> : <span class="type">int</span></h3> <p>This property holds the minimum integer value accepted as input</p> <p>This property is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">IntInput</a> mode.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>intMinimum</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIntMinimum</b></span>(int <i>min</i>)</td></tr> </table></div> <!-- @@@intMinimum --> <!-- $$$intStep-prop$$$intStep$$$setIntStepint --> <h3 class="fn" id="intStep-prop"><a name="intStep-prop"></a><span class="name">intStep</span> : <span class="type">int</span></h3> <p>This property holds the step by which the integer value is increased and decreased</p> <p>This property is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">IntInput</a> mode.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>intStep</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIntStep</b></span>(int <i>step</i>)</td></tr> </table></div> <!-- @@@intStep --> <!-- $$$intValue-prop$$$intValue$$$setIntValueint$$$intValueChangedint --> <h3 class="fn" id="intValue-prop"><a name="intValue-prop"></a><span class="name">intValue</span> : <span class="type">int</span></h3> <p>This property holds the current integer value accepted as input</p> <p>This property is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">IntInput</a> mode.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>intValue</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIntValue</b></span>(int <i>value</i>)</td></tr> </table></div> <p><b>Notifier signal:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qinputdialog.html#intValueChanged">intValueChanged</a></b></span>(int <i>value</i>)</td></tr> </table></div> <!-- @@@intValue --> <!-- $$$labelText-prop$$$labelText$$$setLabelTextconstQString& --> <h3 class="fn" id="labelText-prop"><a name="labelText-prop"></a><span class="name">labelText</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3> <p>This property holds the label's text which describes what needs to be input</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>labelText</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setLabelText</b></span>(const QString &<i>text</i>)</td></tr> </table></div> <!-- @@@labelText --> <!-- $$$okButtonText-prop$$$okButtonText$$$setOkButtonTextconstQString& --> <h3 class="fn" id="okButtonText-prop"><a name="okButtonText-prop"></a><span class="name">okButtonText</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3> <p>This property holds the text for the button used to accept the entry in the dialog</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>okButtonText</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setOkButtonText</b></span>(const QString &<i>text</i>)</td></tr> </table></div> <!-- @@@okButtonText --> <!-- $$$options-prop$$$options$$$setOptionsQInputDialog::InputDialogOptions --> <h3 class="fn" id="options-prop"><a name="options-prop"></a><span class="name">options</span> : <span class="type"><a href="qinputdialog.html#InputDialogOption-enum">InputDialogOptions</a></span></h3> <p>This property holds the various options that affect the look and feel of the dialog</p> <p>By default, all options are disabled.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QInputDialog::InputDialogOptions </td><td class="memItemRight bottomAlign"><span class="name"><b>options</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setOptions</b></span>(QInputDialog::InputDialogOptions <i>options</i>)</td></tr> </table></div> <p><b>See also </b><a href="qinputdialog.html#setOption">setOption</a>() and <a href="qinputdialog.html#testOption">testOption</a>().</p> <!-- @@@options --> <!-- $$$textEchoMode-prop$$$textEchoMode$$$setTextEchoModeQLineEdit::EchoMode --> <h3 class="fn" id="textEchoMode-prop"><a name="textEchoMode-prop"></a><span class="name">textEchoMode</span> : <span class="type"><a href="qlineedit.html#EchoMode-enum">QLineEdit::EchoMode</a></span></h3> <p>This property holds the echo mode for the text value</p> <p>This property is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">TextInput</a> mode.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QLineEdit::EchoMode </td><td class="memItemRight bottomAlign"><span class="name"><b>textEchoMode</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTextEchoMode</b></span>(QLineEdit::EchoMode <i>mode</i>)</td></tr> </table></div> <!-- @@@textEchoMode --> <!-- $$$textValue-prop$$$textValue$$$setTextValueconstQString&$$$textValueChangedconstQString& --> <h3 class="fn" id="textValue-prop"><a name="textValue-prop"></a><span class="name">textValue</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3> <p>This property holds the text value for the input dialog</p> <p>This property is only relevant when the input dialog is used in <a href="qinputdialog.html#InputMode-enum">TextInput</a> mode.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>textValue</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTextValue</b></span>(const QString &<i>text</i>)</td></tr> </table></div> <p><b>Notifier signal:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qinputdialog.html#textValueChanged">textValueChanged</a></b></span>(const QString &<i>text</i>)</td></tr> </table></div> <!-- @@@textValue --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QInputDialog[overload1]$$$QInputDialogQWidget*Qt::WindowFlags --> <h3 class="fn" id="QInputDialog"><a name="QInputDialog"></a>QInputDialog::<span class="name">QInputDialog</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = nullptr, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i> = ...)</h3> <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> <!-- @@@QInputDialog --> <!-- $$$~QInputDialog[overload1]$$$~QInputDialog --> <h3 class="fn" id="dtor.QInputDialog"><a name="dtor.QInputDialog"></a><code>[virtual] </code>QInputDialog::<span class="name">~QInputDialog</span>()</h3> <p>Destroys the input dialog.</p> <p>This function was introduced in Qt 4.5.</p> <!-- @@@~QInputDialog --> <!-- $$$done[overload1]$$$doneint --> <h3 class="fn" id="done"><a name="done"></a><code>[override virtual] </code><span class="type">void</span> QInputDialog::<span class="name">done</span>(<span class="type">int</span> <i>result</i>)</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><b>See also </b><a href="qdialog.html#done">QDialog::done</a>().</p> <!-- @@@done --> <!-- $$$doubleValueChanged --> <h3 class="fn" id="doubleValueChanged"><a name="doubleValueChanged"></a><code>[signal] </code><span class="type">void</span> QInputDialog::<span class="name">doubleValueChanged</span>(<span class="type">double</span> <i>value</i>)</h3> <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> <p><b>Note:</b> Notifier signal for property <a href="qinputdialog.html#doubleValue-prop">doubleValue</a>. </p><!-- @@@doubleValueChanged --> <!-- $$$doubleValueSelected[overload1]$$$doubleValueSelecteddouble --> <h3 class="fn" id="doubleValueSelected"><a name="doubleValueSelected"></a><code>[signal] </code><span class="type">void</span> QInputDialog::<span class="name">doubleValueSelected</span>(<span class="type">double</span> <i>value</i>)</h3> <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> <!-- @@@doubleValueSelected --> <!-- $$$getDouble[overload1]$$$getDoubleQWidget*constQString&constQString&doubledoubledoubleintbool*Qt::WindowFlags --> <h3 class="fn" id="getDouble"><a name="getDouble"></a><code>[static] </code><span class="type">double</span> QInputDialog::<span class="name">getDouble</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>title</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>label</i>, <span class="type">double</span> <i>value</i> = 0, <span class="type">double</span> <i>min</i> = -2147483647, <span class="type">double</span> <i>max</i> = 2147483647, <span class="type">int</span> <i>decimals</i> = 1, <span class="type">bool</span> *<i>ok</i> = nullptr, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i> = ...)</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 class="cpp"> bool ok; <span class="type">double</span> d <span class="operator">=</span> <span class="type"><a href="qinputdialog.html#QInputDialog">QInputDialog</a></span><span class="operator">::</span>getDouble(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">"QInputDialog::getDouble()"</span>)<span class="operator">,</span> tr(<span class="string">"Amount:"</span>)<span class="operator">,</span> <span class="number">37.56</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10000</span><span class="operator">,</span> <span class="number">10000</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="operator">&</span>ok); <span class="keyword">if</span> (ok) doubleLabel<span class="operator">-</span><span class="operator">></span>setText(<span class="type"><a href="../qtcore/qstring.html">QString</a></span>(<span class="string">"$%1"</span>)<span class="operator">.</span>arg(d)); </pre> <p><b>See also </b><a href="qinputdialog.html#getText">getText</a>(), <a href="qinputdialog.html#getInt">getInt</a>(), <a href="qinputdialog.html#getItem">getItem</a>(), and <a href="qinputdialog.html#getMultiLineText">getMultiLineText</a>().</p> <!-- @@@getDouble --> <!-- $$$getDouble$$$getDoubleQWidget*constQString&constQString&doubledoubledoubleintbool*Qt::WindowFlagsdouble --> <h3 class="fn" id="getDouble-1"><a name="getDouble-1"></a><code>[static] </code><span class="type">double</span> QInputDialog::<span class="name">getDouble</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>title</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>label</i>, <span class="type">double</span> <i>value</i>, <span class="type">double</span> <i>min</i>, <span class="type">double</span> <i>max</i>, <span class="type">int</span> <i>decimals</i>, <span class="type">bool</span> *<i>ok</i>, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i>, <span class="type">double</span> <i>step</i>)</h3> <p>This is an overloaded function.</p> <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. <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>This function returns the floating point number which has been entered by the user.</p> <p>Use this static function like this:</p> <pre class="cpp"> bool ok; <span class="type">double</span> d <span class="operator">=</span> <span class="type"><a href="qinputdialog.html#QInputDialog">QInputDialog</a></span><span class="operator">::</span>getDouble(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">"QInputDialog::getDouble()"</span>)<span class="operator">,</span> tr(<span class="string">"Amount:"</span>)<span class="operator">,</span> <span class="number">37.56</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10000</span><span class="operator">,</span> <span class="number">10000</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="operator">&</span>ok); <span class="keyword">if</span> (ok) doubleLabel<span class="operator">-</span><span class="operator">></span>setText(<span class="type"><a href="../qtcore/qstring.html">QString</a></span>(<span class="string">"$%1"</span>)<span class="operator">.</span>arg(d)); </pre> <p><b>See also </b><a href="qinputdialog.html#getText">getText</a>(), <a href="qinputdialog.html#getInt">getInt</a>(), <a href="qinputdialog.html#getItem">getItem</a>(), and <a href="qinputdialog.html#getMultiLineText">getMultiLineText</a>().</p> <!-- @@@getDouble --> <!-- $$$getInt[overload1]$$$getIntQWidget*constQString&constQString&intintintintbool*Qt::WindowFlags --> <h3 class="fn" id="getInt"><a name="getInt"></a><code>[static] </code><span class="type">int</span> QInputDialog::<span class="name">getInt</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>title</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>label</i>, <span class="type">int</span> <i>value</i> = 0, <span class="type">int</span> <i>min</i> = -2147483647, <span class="type">int</span> <i>max</i> = 2147483647, <span class="type">int</span> <i>step</i> = 1, <span class="type">bool</span> *<i>ok</i> = nullptr, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i> = ...)</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 class="cpp"> bool ok; <span class="type">int</span> i <span class="operator">=</span> <span class="type"><a href="qinputdialog.html#QInputDialog">QInputDialog</a></span><span class="operator">::</span>getInt(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">"QInputDialog::getInteger()"</span>)<span class="operator">,</span> tr(<span class="string">"Percentage:"</span>)<span class="operator">,</span> <span class="number">25</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">100</span><span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="operator">&</span>ok); <span class="keyword">if</span> (ok) integerLabel<span class="operator">-</span><span class="operator">></span>setText(tr(<span class="string">"%1%"</span>)<span class="operator">.</span>arg(i)); </pre> <p>This function was introduced in Qt 4.5.</p> <p><b>See also </b><a href="qinputdialog.html#getText">getText</a>(), <a href="qinputdialog.html#getDouble">getDouble</a>(), <a href="qinputdialog.html#getItem">getItem</a>(), and <a href="qinputdialog.html#getMultiLineText">getMultiLineText</a>().</p> <!-- @@@getInt --> <!-- $$$getItem[overload1]$$$getItemQWidget*constQString&constQString&constQStringList&intboolbool*Qt::WindowFlagsQt::InputMethodHints --> <h3 class="fn" id="getItem"><a name="getItem"></a><code>[static] </code><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QInputDialog::<span class="name">getItem</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>title</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>label</i>, const <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> &<i>items</i>, <span class="type">int</span> <i>current</i> = 0, <span class="type">bool</span> <i>editable</i> = true, <span class="type">bool</span> *<i>ok</i> = nullptr, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i> = ..., <span class="type"><a href="../qtcore/qt.html#InputMethodHint-enum">Qt::InputMethodHints</a></span> <i>inputMethodHints</i> = Qt::ImhNone)</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 combo box. <i>current</i> is the number of the item which should be the current item. <i>inputMethodHints</i> is the input method hints that will be used if the combo box is editable and an input method is active.</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>*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 text of the current item, or if <i>editable</i> is true, the current text of the combo box.</p> <p>Use this static function like this:</p> <pre class="cpp"> <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> items; items <span class="operator"><</span><span class="operator"><</span> tr(<span class="string">"Spring"</span>) <span class="operator"><</span><span class="operator"><</span> tr(<span class="string">"Summer"</span>) <span class="operator"><</span><span class="operator"><</span> tr(<span class="string">"Fall"</span>) <span class="operator"><</span><span class="operator"><</span> tr(<span class="string">"Winter"</span>); bool ok; <span class="type"><a href="../qtcore/qstring.html">QString</a></span> item <span class="operator">=</span> <span class="type"><a href="qinputdialog.html#QInputDialog">QInputDialog</a></span><span class="operator">::</span>getItem(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">"QInputDialog::getItem()"</span>)<span class="operator">,</span> tr(<span class="string">"Season:"</span>)<span class="operator">,</span> items<span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="keyword">false</span><span class="operator">,</span> <span class="operator">&</span>ok); <span class="keyword">if</span> (ok <span class="operator">&</span><span class="operator">&</span> <span class="operator">!</span>item<span class="operator">.</span>isEmpty()) itemLabel<span class="operator">-</span><span class="operator">></span>setText(item); </pre> <p><b>See also </b><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#getMultiLineText">getMultiLineText</a>().</p> <!-- @@@getItem --> <!-- $$$getMultiLineText[overload1]$$$getMultiLineTextQWidget*constQString&constQString&constQString&bool*Qt::WindowFlagsQt::InputMethodHints --> <h3 class="fn" id="getMultiLineText"><a name="getMultiLineText"></a><code>[static] </code><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QInputDialog::<span class="name">getMultiLineText</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>title</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>label</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>text</i> = QString(), <span class="type">bool</span> *<i>ok</i> = nullptr, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i> = ..., <span class="type"><a href="../qtcore/qt.html#InputMethodHint-enum">Qt::InputMethodHints</a></span> <i>inputMethodHints</i> = Qt::ImhNone)</h3> <p>Static convenience function to get a multiline 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 plain text edit. <i>inputMethodHints</i> is the input method hints that will be used in the edit widget if an input method is active.</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 specified widget <i>flags</i>.</p> <p>If the dialog is accepted, this function returns the text in the dialog's plain text edit. If the dialog is rejected, a null <a href="../qtcore/qstring.html">QString</a> is returned.</p> <p>Use this static function like this:</p> <pre class="cpp"> bool ok; <span class="type"><a href="../qtcore/qstring.html">QString</a></span> text <span class="operator">=</span> <span class="type"><a href="qinputdialog.html#QInputDialog">QInputDialog</a></span><span class="operator">::</span>getMultiLineText(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">"QInputDialog::getMultiLineText()"</span>)<span class="operator">,</span> tr(<span class="string">"Address:"</span>)<span class="operator">,</span> <span class="string">"John Doe\nFreedom Street"</span><span class="operator">,</span> <span class="operator">&</span>ok); <span class="keyword">if</span> (ok <span class="operator">&</span><span class="operator">&</span> <span class="operator">!</span>text<span class="operator">.</span>isEmpty()) multiLineTextLabel<span class="operator">-</span><span class="operator">></span>setText(text); </pre> <p>This function was introduced in Qt 5.2.</p> <p><b>See also </b><a href="qinputdialog.html#getInt">getInt</a>(), <a href="qinputdialog.html#getDouble">getDouble</a>(), <a href="qinputdialog.html#getItem">getItem</a>(), and <a href="qinputdialog.html#getText">getText</a>().</p> <!-- @@@getMultiLineText --> <!-- $$$getText[overload1]$$$getTextQWidget*constQString&constQString&QLineEdit::EchoModeconstQString&bool*Qt::WindowFlagsQt::InputMethodHints --> <h3 class="fn" id="getText"><a name="getText"></a><code>[static] </code><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QInputDialog::<span class="name">getText</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>title</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>label</i>, <span class="type"><a href="qlineedit.html#EchoMode-enum">QLineEdit::EchoMode</a></span> <i>mode</i> = QLineEdit::Normal, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>text</i> = QString(), <span class="type">bool</span> *<i>ok</i> = nullptr, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i> = ..., <span class="type"><a href="../qtcore/qt.html#InputMethodHint-enum">Qt::InputMethodHints</a></span> <i>inputMethodHints</i> = Qt::ImhNone)</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. <i>inputMethodHints</i> is the input method hints that will be used in the edit widget if an input method is active.</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 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="../qtcore/qstring.html">QString</a> is returned.</p> <p>Use this static function like this:</p> <pre class="cpp"> bool ok; <span class="type"><a href="../qtcore/qstring.html">QString</a></span> text <span class="operator">=</span> <span class="type"><a href="qinputdialog.html#QInputDialog">QInputDialog</a></span><span class="operator">::</span>getText(<span class="keyword">this</span><span class="operator">,</span> tr(<span class="string">"QInputDialog::getText()"</span>)<span class="operator">,</span> tr(<span class="string">"User name:"</span>)<span class="operator">,</span> <span class="type"><a href="qlineedit.html">QLineEdit</a></span><span class="operator">::</span>Normal<span class="operator">,</span> <span class="type"><a href="../qtcore/qdir.html">QDir</a></span><span class="operator">::</span>home()<span class="operator">.</span>dirName()<span class="operator">,</span> <span class="operator">&</span>ok); <span class="keyword">if</span> (ok <span class="operator">&</span><span class="operator">&</span> <span class="operator">!</span>text<span class="operator">.</span>isEmpty()) textLabel<span class="operator">-</span><span class="operator">></span>setText(text); </pre> <p><b>See also </b><a href="qinputdialog.html#getInt">getInt</a>(), <a href="qinputdialog.html#getDouble">getDouble</a>(), <a href="qinputdialog.html#getItem">getItem</a>(), and <a href="qinputdialog.html#getMultiLineText">getMultiLineText</a>().</p> <!-- @@@getText --> <!-- $$$intValueChanged --> <h3 class="fn" id="intValueChanged"><a name="intValueChanged"></a><code>[signal] </code><span class="type">void</span> QInputDialog::<span class="name">intValueChanged</span>(<span class="type">int</span> <i>value</i>)</h3> <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> <p><b>Note:</b> Notifier signal for property <a href="qinputdialog.html#intValue-prop">intValue</a>. </p><!-- @@@intValueChanged --> <!-- $$$intValueSelected[overload1]$$$intValueSelectedint --> <h3 class="fn" id="intValueSelected"><a name="intValueSelected"></a><code>[signal] </code><span class="type">void</span> QInputDialog::<span class="name">intValueSelected</span>(<span class="type">int</span> <i>value</i>)</h3> <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> <!-- @@@intValueSelected --> <!-- $$$minimumSizeHint[overload1]$$$minimumSizeHint --> <h3 class="fn" id="minimumSizeHint"><a name="minimumSizeHint"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QInputDialog::<span class="name">minimumSizeHint</span>() const</h3> <p>Reimplemented from <a href="qdialog.html#minimumSizeHint">QDialog::minimumSizeHint</a>().</p> <!-- @@@minimumSizeHint --> <!-- $$$open[overload1]$$$openQObject*constchar* --> <h3 class="fn" id="open"><a name="open"></a><span class="type">void</span> QInputDialog::<span class="name">open</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>receiver</i>, const <span class="type">char</span> *<i>member</i>)</h3> <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="../qtcore/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> <!-- @@@open --> <!-- $$$setDoubleRange[overload1]$$$setDoubleRangedoubledouble --> <h3 class="fn" id="setDoubleRange"><a name="setDoubleRange"></a><span class="type">void</span> QInputDialog::<span class="name">setDoubleRange</span>(<span class="type">double</span> <i>min</i>, <span class="type">double</span> <i>max</i>)</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> <!-- @@@setDoubleRange --> <!-- $$$setIntRange[overload1]$$$setIntRangeintint --> <h3 class="fn" id="setIntRange"><a name="setIntRange"></a><span class="type">void</span> QInputDialog::<span class="name">setIntRange</span>(<span class="type">int</span> <i>min</i>, <span class="type">int</span> <i>max</i>)</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> <!-- @@@setIntRange --> <!-- $$$setOption[overload1]$$$setOptionQInputDialog::InputDialogOptionbool --> <h3 class="fn" id="setOption"><a name="setOption"></a><span class="type">void</span> QInputDialog::<span class="name">setOption</span>(<span class="type"><a href="qinputdialog.html#InputDialogOption-enum">QInputDialog::InputDialogOption</a></span> <i>option</i>, <span class="type">bool</span> <i>on</i> = 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><b>See also </b><a href="qtwidgets-cmake-qt5-wrap-ui.html#options">options</a> and <a href="qinputdialog.html#testOption">testOption</a>().</p> <!-- @@@setOption --> <!-- $$$setVisible[overload1]$$$setVisiblebool --> <h3 class="fn" id="setVisible"><a name="setVisible"></a><code>[override virtual] </code><span class="type">void</span> QInputDialog::<span class="name">setVisible</span>(<span class="type">bool</span> <i>visible</i>)</h3> <p>Reimplemented from <a href="qdialog.html#setVisible">QDialog::setVisible</a>().</p> <!-- @@@setVisible --> <!-- $$$sizeHint[overload1]$$$sizeHint --> <h3 class="fn" id="sizeHint"><a name="sizeHint"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QInputDialog::<span class="name">sizeHint</span>() const</h3> <p>Reimplemented from <a href="qdialog.html#sizeHint">QDialog::sizeHint</a>().</p> <!-- @@@sizeHint --> <!-- $$$testOption[overload1]$$$testOptionQInputDialog::InputDialogOption --> <h3 class="fn" id="testOption"><a name="testOption"></a><span class="type">bool</span> QInputDialog::<span class="name">testOption</span>(<span class="type"><a href="qinputdialog.html#InputDialogOption-enum">QInputDialog::InputDialogOption</a></span> <i>option</i>) const</h3> <p>Returns <code>true</code> if the given <i>option</i> is enabled; otherwise, returns false.</p> <p><b>See also </b><a href="qtwidgets-cmake-qt5-wrap-ui.html#options">options</a> and <a href="qinputdialog.html#setOption">setOption</a>().</p> <!-- @@@testOption --> <!-- $$$textValueChanged --> <h3 class="fn" id="textValueChanged"><a name="textValueChanged"></a><code>[signal] </code><span class="type">void</span> QInputDialog::<span class="name">textValueChanged</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>text</i>)</h3> <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> <p><b>Note:</b> Notifier signal for property <a href="qinputdialog.html#textValue-prop">textValue</a>. </p><!-- @@@textValueChanged --> <!-- $$$textValueSelected[overload1]$$$textValueSelectedconstQString& --> <h3 class="fn" id="textValueSelected"><a name="textValueSelected"></a><code>[signal] </code><span class="type">void</span> QInputDialog::<span class="name">textValueSelected</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>text</i>)</h3> <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> <!-- @@@textValueSelected --> </div> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br/> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br/> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>