com.trolltech.qt.gui
Class QInputDialog

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.core.QObject
                  extended by com.trolltech.qt.gui.QWidget
                      extended by com.trolltech.qt.gui.QDialog
                          extended by com.trolltech.qt.gui.QInputDialog
All Implemented Interfaces:
QPaintDeviceInterface, QtJambiInterface

public class QInputDialog
extends QDialog

The QInputDialog class provides a simple convenience dialog to get a single value from the user. 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.

Four static convenience functions are provided: getText(), getInt(), getDouble(), and getItem(). All the functions can be used in a similar way, for example:

The following code example is written in c++.

    bool ok;
    QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"),
                                         tr("User name:"), QLineEdit::Normal,
                                         QDir::home().dirName(), &ok);
    if (ok && !text.isEmpty())
        textLabel->setText(text);
The ok variable is set to true if the user clicks OK; otherwise it is set to false.

The Standard Dialogs example shows how to use QInputDialog as well as other built-in Qt dialogs.

See also:
QMessageBox, and Standard Dialogs Example.


Nested Class Summary
static class QInputDialog.InputDialogOption
          This enum specifies various options that affect the look and feel of an input dialog.
static class QInputDialog.InputDialogOptions
           
static class QInputDialog.InputMode
          This enum describes the different modes of input that can be selected for the dialog.
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QDialog
QDialog.DialogCode
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget
QWidget.RenderFlag, QWidget.RenderFlags
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 QSignalEmitter.Signal1 doubleValueChanged
          This signal takes 1 generic argument(s).
 QSignalEmitter.Signal1 doubleValueSelected
          This signal takes 1 generic argument(s).
 QSignalEmitter.Signal1 intValueChanged
          This signal takes 1 generic argument(s).
 QSignalEmitter.Signal1 intValueSelected
          This signal takes 1 generic argument(s).
 QSignalEmitter.Signal1 textValueChanged
          This signal takes 1 generic argument(s).
 QSignalEmitter.Signal1 textValueSelected
          This signal takes 1 generic argument(s).
 
Fields inherited from class com.trolltech.qt.gui.QDialog
accepted, finished, rejected
 
Fields inherited from class com.trolltech.qt.gui.QWidget
customContextMenuRequested
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QInputDialog()
          Constructs a new input dialog with the given parent and window flags.
QInputDialog(QWidget parent)
          Constructs a new input dialog with the given parent and window flags.
QInputDialog(QWidget parent, Qt.WindowFlags flags)
          Constructs a new input dialog with the given parent and window flags.
QInputDialog(QWidget parent, Qt.WindowType[] flags)
          This is an overloaded method provided for convenience.
 
Method Summary
 java.lang.String cancelButtonText()
          This property holds the text for the button used to cancel the dialog.
 java.util.List comboBoxItems()
          This property holds the items used in the combobox for the input dialog.
 int doubleDecimals()
          This property holds sets the percision of the double spinbox in decimals.
 double doubleMaximum()
          This property holds the maximum double precision floating point value accepted as input.
 double doubleMinimum()
          This property holds the minimum double precision floating point value accepted as input.
 double doubleValue()
          This property holds the current double precision floating point value accepted as input.
static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label)
          This is a overloaded function provided for convenience.
static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label, double value)
          This is a overloaded function provided for convenience.
static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue)
          This is a overloaded function provided for convenience.
static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue, double maxValue)
          This is a overloaded function provided for convenience.
static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue, double maxValue, int decimals)
          This is a overloaded function provided for convenience.
static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue, double maxValue, int decimals, Qt.WindowFlags f)
          Static convenience function to get a floating point number from the user.
static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue, double maxValue, int decimals, Qt.WindowType[] f)
          Static convenience function to get a floating point number from the user.
static java.lang.Integer getInt(QWidget parent, java.lang.String title, java.lang.String label)
           
static java.lang.Integer getInt(QWidget parent, java.lang.String title, java.lang.String label, int value)
           
static java.lang.Integer getInt(QWidget parent, java.lang.String title, java.lang.String label, int value, int min, int max)
           
static java.lang.Integer getInt(QWidget parent, java.lang.String title, java.lang.String label, int value, int min, int max, int step)
           
static java.lang.Integer getInt(QWidget parent, java.lang.String title, java.lang.String label, int value, int min, int max, int step, Qt.WindowFlags flags)
           
static java.lang.Integer getInt(QWidget parent, java.lang.String title, java.lang.String label, int value, int min, int max, int step, Qt.WindowType[] f)
           
static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label)
          This is a overloaded function provided for convenience.
static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label, int value)
          This is a overloaded function provided for convenience.
static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue)
          This is a overloaded function provided for convenience.
static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue, int maxValue)
          This is a overloaded function provided for convenience.
static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue, int maxValue, int step)
          This is a overloaded function provided for convenience.
static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue, int maxValue, int step, Qt.WindowFlags f)
          Static convenience function to get an integer input from the user.
static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue, int maxValue, int step, Qt.WindowType[] f)
          Static convenience function to get an integer input from the user.
static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List list)
          This is a overloaded function provided for convenience.
static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List list, int current)
          This is a overloaded function provided for convenience.
static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List list, int current, boolean editable)
          This is a overloaded function provided for convenience.
static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List list, int current, boolean editable, Qt.WindowFlags f)
          Static convenience function to let the user select an item from a string list.
static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List list, int current, boolean editable, Qt.WindowType[] f)
          Static convenience function to let the user select an item from a string list.
static java.lang.String getText(QWidget parent, java.lang.String title, java.lang.String label)
          This is a overloaded function provided for convenience.
static java.lang.String getText(QWidget parent, java.lang.String title, java.lang.String label, QLineEdit.EchoMode echo)
          Static convenience function to get a string from the user.
static java.lang.String getText(QWidget parent, java.lang.String title, java.lang.String label, QLineEdit.EchoMode echo, java.lang.String text)
          Static convenience function to get a string from the user.
static java.lang.String getText(QWidget parent, java.lang.String title, java.lang.String label, QLineEdit.EchoMode echo, java.lang.String text, Qt.WindowFlags f)
          Static convenience function to get a string from the user.
static java.lang.String getText(QWidget parent, java.lang.String title, java.lang.String label, QLineEdit.EchoMode echo, java.lang.String text, Qt.WindowType[] f)
          Static convenience function to get a string from the user.
 QInputDialog.InputMode inputMode()
          This property holds the mode used for input.
 int intMaximum()
          This property holds the maximum integer value accepted as input.
 int intMinimum()
          This property holds the minimum integer value accepted as input.
 int intStep()
          This property holds the step by which the integer value is increased and decreased.
 int intValue()
          This property holds the current integer value accepted as input.
 boolean isComboBoxEditable()
           
 java.lang.String labelText()
          This property holds the text to for the label to describe what needs to be input.
 java.lang.String okButtonText()
          This property holds the text for the button used to accept the entry in the dialog.
 QInputDialog.InputDialogOptions options()
          This property holds the various options that affect the look and feel of the dialog.
 void setCancelButtonText(java.lang.String text)
          This property holds the text for the button used to cancel the dialog.
 void setComboBoxEditable(boolean editable)
           
 void setComboBoxItems(java.util.List items)
          This property holds the items used in the combobox for the input dialog.
 void setDoubleDecimals(int decimals)
          This property holds sets the percision of the double spinbox in decimals.
 void setDoubleMaximum(double max)
          This property holds the maximum double precision floating point value accepted as input.
 void setDoubleMinimum(double min)
          This property holds the minimum double precision floating point value accepted as input.
 void setDoubleRange(double min, double max)
          Sets the range of double precision floating point values accepted by the dialog when used in DoubleInput mode, with minimum and maximum values specified by min and max respectively.
 void setDoubleValue(double value)
          This property holds the current double precision floating point value accepted as input.
 void setInputMode(QInputDialog.InputMode mode)
          This property holds the mode used for input.
 void setIntMaximum(int max)
          This property holds the maximum integer value accepted as input.
 void setIntMinimum(int min)
          This property holds the minimum integer value accepted as input.
 void setIntRange(int min, int max)
          Sets the range of integer values accepted by the dialog when used in IntInput mode, with minimum and maximum values specified by min and max respectively.
 void setIntStep(int step)
          This property holds the step by which the integer value is increased and decreased.
 void setIntValue(int value)
          This property holds the current integer value accepted as input.
 void setLabelText(java.lang.String text)
          This property holds the text to for the label to describe what needs to be input.
 void setOkButtonText(java.lang.String text)
          This property holds the text for the button used to accept the entry in the dialog.
 void setOption(QInputDialog.InputDialogOption option)
          Sets the given option to be enabled if on is true; otherwise, clears the given option.
 void setOption(QInputDialog.InputDialogOption option, boolean on)
          Sets the given option to be enabled if on is true; otherwise, clears the given option.
 void setOptions(QInputDialog.InputDialogOption[] options)
          This is an overloaded method provided for convenience.
 void setOptions(QInputDialog.InputDialogOptions options)
          This property holds the various options that affect the look and feel of the dialog.
 void setTextEchoMode(QLineEdit.EchoMode mode)
          This property holds the echo mode for the text value.
 void setTextValue(java.lang.String text)
          This property holds the text value for the input dialog.
 boolean testOption(QInputDialog.InputDialogOption option)
          Returns true if the given option is enabled; otherwise, returns false.
 QLineEdit.EchoMode textEchoMode()
          This property holds the echo mode for the text value.
 java.lang.String textValue()
          This property holds the text value for the input dialog.
 
Methods inherited from class com.trolltech.qt.gui.QDialog
accept, done, exec, isSizeGripEnabled, open, reject, result, setModal, setResult, setSizeGripEnabled
 
Methods inherited from class com.trolltech.qt.gui.QWidget
acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsRect, contextMenuEvent, contextMenuPolicy, cursor, depth, destroy, destroy, destroy, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, ensurePolished, enterEvent, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, graphicsProxyWidget, hasFocus, hasMouseTracking, height, heightForWidth, heightMM, hide, hideEvent, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isMaximized, isMinimized, isModal, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, keyPressEvent, keyReleaseEvent, languageChange, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, overrideWindowState, paintEngine, paintEvent, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, render, render, render, render, render, repaint, repaint, repaint, repaint, resetInputContext, resize, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setBaseSize, setContentsMargins, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setLocale, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setParent, setParent, setShortcutAutoRepeat, setShortcutAutoRepeat, setShortcutEnabled, setShortcutEnabled, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, underMouse, unsetCursor, unsetLayoutDirection, unsetLocale, update, update, update, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, widthMM, window, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y
 
Methods inherited from class com.trolltech.qt.core.QObject
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Field Detail

doubleValueChanged

public final QSignalEmitter.Signal1 doubleValueChanged

This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Double(named: value)>:

This signal is emitted whenever the double value changes in the dialog. The current value is specified by value.

This signal is only relevant when the input dialog is used in DoubleInput mode.


doubleValueSelected

public final QSignalEmitter.Signal1 doubleValueSelected

This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Double(named: value)>:

This signal is emitted whenever the user selects a double value by accepting the dialog; for example, by clicking the OK button. The selected value is specified by value.

This signal is only relevant when the input dialog is used in DoubleInput mode.


intValueChanged

public final QSignalEmitter.Signal1 intValueChanged

This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: value)>:

This signal is emitted whenever the integer value changes in the dialog. The current value is specified by value.

This signal is only relevant when the input dialog is used in IntInput mode.


intValueSelected

public final QSignalEmitter.Signal1 intValueSelected

This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: value)>:

This signal is emitted whenever the user selects a integer value by accepting the dialog; for example, by clicking the OK button. The selected value is specified by value.

This signal is only relevant when the input dialog is used in IntInput mode.


textValueChanged

public final QSignalEmitter.Signal1 textValueChanged

This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.String(named: text)>:

This signal is emitted whenever the text string changes in the dialog. The current string is specified by text.

This signal is only relevant when the input dialog is used in TextInput mode.


textValueSelected

public final QSignalEmitter.Signal1 textValueSelected

This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.String(named: text)>:

This signal is emitted whenever the user selects a text string by accepting the dialog; for example, by clicking the OK button. The selected string is specified by text.

This signal is only relevant when the input dialog is used in TextInput mode.

Constructor Detail

QInputDialog

public QInputDialog(QWidget parent,
                    Qt.WindowType[] flags)
This is an overloaded method provided for convenience.


QInputDialog

public QInputDialog(QWidget parent)
Constructs a new input dialog with the given parent and window flags.


QInputDialog

public QInputDialog()
Constructs a new input dialog with the given parent and window flags.


QInputDialog

public QInputDialog(QWidget parent,
                    Qt.WindowFlags flags)
Constructs a new input dialog with the given parent and window flags.

Method Detail

cancelButtonText

public final java.lang.String cancelButtonText()
This property holds the text for the button used to cancel the dialog.


comboBoxItems

public final java.util.List comboBoxItems()
This property holds the items used in the combobox for the input dialog.


doubleDecimals

public final int doubleDecimals()
This property holds sets the percision of the double spinbox in decimals.

See also:
QDoubleSpinBox::setDecimals().


doubleMaximum

public final double doubleMaximum()
This property holds the maximum double precision floating point value accepted as input. This property is only relevant when the input dialog is used in DoubleInput mode.


doubleMinimum

public final double doubleMinimum()
This property holds the minimum double precision floating point value accepted as input. This property is only relevant when the input dialog is used in DoubleInput mode.


doubleValue

public final double doubleValue()
This property holds the current double precision floating point value accepted as input. This property is only relevant when the input dialog is used in DoubleInput mode.


inputMode

public final QInputDialog.InputMode inputMode()
This property holds the mode used for input. This property help determines which widget is used for entering input into the dialog.


intMaximum

public final int intMaximum()
This property holds the maximum integer value accepted as input. This property is only relevant when the input dialog is used in IntInput mode.


intMinimum

public final int intMinimum()
This property holds the minimum integer value accepted as input. This property is only relevant when the input dialog is used in IntInput mode.


intStep

public final int intStep()
This property holds the step by which the integer value is increased and decreased. This property is only relevant when the input dialog is used in IntInput mode.


intValue

public final int intValue()
This property holds the current integer value accepted as input. This property is only relevant when the input dialog is used in IntInput mode.


isComboBoxEditable

public final boolean isComboBoxEditable()

labelText

public final java.lang.String labelText()
This property holds the text to for the label to describe what needs to be input.


okButtonText

public final java.lang.String okButtonText()
This property holds the text for the button used to accept the entry in the dialog.


options

public final QInputDialog.InputDialogOptions options()
This property holds the various options that affect the look and feel of the dialog. By default, all options are disabled.

See also:
setOption(), and testOption().


setCancelButtonText

public final void setCancelButtonText(java.lang.String text)
This property holds the text for the button used to cancel the dialog.


setComboBoxEditable

public final void setComboBoxEditable(boolean editable)

setComboBoxItems

public final void setComboBoxItems(java.util.List items)
This property holds the items used in the combobox for the input dialog.


setDoubleDecimals

public final void setDoubleDecimals(int decimals)
This property holds sets the percision of the double spinbox in decimals.

See also:
QDoubleSpinBox::setDecimals().


setDoubleMaximum

public final void setDoubleMaximum(double max)
This property holds the maximum double precision floating point value accepted as input. This property is only relevant when the input dialog is used in DoubleInput mode.


setDoubleMinimum

public final void setDoubleMinimum(double min)
This property holds the minimum double precision floating point value accepted as input. This property is only relevant when the input dialog is used in DoubleInput mode.


setDoubleRange

public final void setDoubleRange(double min,
                                 double max)
Sets the range of double precision floating point values accepted by the dialog when used in DoubleInput mode, with minimum and maximum values specified by min and max respectively.


setDoubleValue

public final void setDoubleValue(double value)
This property holds the current double precision floating point value accepted as input. This property is only relevant when the input dialog is used in DoubleInput mode.


setInputMode

public final void setInputMode(QInputDialog.InputMode mode)
This property holds the mode used for input. This property help determines which widget is used for entering input into the dialog.


setIntMaximum

public final void setIntMaximum(int max)
This property holds the maximum integer value accepted as input. This property is only relevant when the input dialog is used in IntInput mode.


setIntMinimum

public final void setIntMinimum(int min)
This property holds the minimum integer value accepted as input. This property is only relevant when the input dialog is used in IntInput mode.


setIntRange

public final void setIntRange(int min,
                              int max)
Sets the range of integer values accepted by the dialog when used in IntInput mode, with minimum and maximum values specified by min and max respectively.


setIntStep

public final void setIntStep(int step)
This property holds the step by which the integer value is increased and decreased. This property is only relevant when the input dialog is used in IntInput mode.


setIntValue

public final void setIntValue(int value)
This property holds the current integer value accepted as input. This property is only relevant when the input dialog is used in IntInput mode.


setLabelText

public final void setLabelText(java.lang.String text)
This property holds the text to for the label to describe what needs to be input.


setOkButtonText

public final void setOkButtonText(java.lang.String text)
This property holds the text for the button used to accept the entry in the dialog.


setOption

public final void setOption(QInputDialog.InputDialogOption option)
Sets the given option to be enabled if on is true; otherwise, clears the given option.

See also:
options, and testOption().


setOption

public final void setOption(QInputDialog.InputDialogOption option,
                            boolean on)
Sets the given option to be enabled if on is true; otherwise, clears the given option.

See also:
options, and testOption().


setOptions

public final void setOptions(QInputDialog.InputDialogOption[] options)
This is an overloaded method provided for convenience.


setOptions

public final void setOptions(QInputDialog.InputDialogOptions options)
This property holds the various options that affect the look and feel of the dialog. By default, all options are disabled.

See also:
setOption(), and testOption().


setTextEchoMode

public final void setTextEchoMode(QLineEdit.EchoMode mode)
This property holds the echo mode for the text value. This property is only relevant when the input dialog is used in TextInput mode.


setTextValue

public final void setTextValue(java.lang.String text)
This property holds the text value for the input dialog. This property is only relevant when the input dialog is used in TextInput mode.


testOption

public final boolean testOption(QInputDialog.InputDialogOption option)
Returns true if the given option is enabled; otherwise, returns false.

See also:
options, and setOption().


textEchoMode

public final QLineEdit.EchoMode textEchoMode()
This property holds the echo mode for the text value. This property is only relevant when the input dialog is used in TextInput mode.


textValue

public final java.lang.String textValue()
This property holds the text value for the input dialog. This property is only relevant when the input dialog is used in TextInput mode.


getInt

public static final java.lang.Integer getInt(QWidget parent,
                                             java.lang.String title,
                                             java.lang.String label,
                                             int value,
                                             int min,
                                             int max,
                                             int step,
                                             Qt.WindowFlags flags)

getInt

public static final java.lang.Integer getInt(QWidget parent,
                                             java.lang.String title,
                                             java.lang.String label,
                                             int value,
                                             int min,
                                             int max,
                                             int step,
                                             Qt.WindowType[] f)

getInt

public static final java.lang.Integer getInt(QWidget parent,
                                             java.lang.String title,
                                             java.lang.String label,
                                             int value,
                                             int min,
                                             int max,
                                             int step)

getInt

public static final java.lang.Integer getInt(QWidget parent,
                                             java.lang.String title,
                                             java.lang.String label,
                                             int value,
                                             int min,
                                             int max)

getInt

public static final java.lang.Integer getInt(QWidget parent,
                                             java.lang.String title,
                                             java.lang.String label,
                                             int value)

getInt

public static final java.lang.Integer getInt(QWidget parent,
                                             java.lang.String title,
                                             java.lang.String label)

getDouble

public static java.lang.Double getDouble(QWidget parent,
                                         java.lang.String title,
                                         java.lang.String label,
                                         double value,
                                         double minValue,
                                         double maxValue,
                                         int decimals,
                                         Qt.WindowFlags f)
Static convenience function to get a floating point number from the user. title is the text which is displayed in the title bar of the dialog. label is the text which is shown to the user (it should say what should be entered). value is the default floating point number that the line edit will be set to. minValue and maxValue are the minimum and maximum values the user may choose, and decimals is the maximum number of decimal places the number may have.

If ok is non-null, *ok will be set to true if the user pressed OK and to false if the user pressed Cancel. The dialog's parent is parent. The dialog will be modal and uses the widget flags f.

This function returns the floating point number which has been entered by the user.

Use this static function like this:

The following code example is written in c++.

    bool ok;
    double d = QInputDialog::getDouble(this, tr("QInputDialog::getDouble()"),
                                       tr("Amount:"), 37.56, -10000, 10000, 2, &ok);
    if (ok)
        doubleLabel->setText(QString("$%1").arg(d));

See also:
getText(), getInteger(), and getItem().


getDouble

public static java.lang.Double getDouble(QWidget parent,
                                         java.lang.String title,
                                         java.lang.String label,
                                         double value,
                                         double minValue,
                                         double maxValue,
                                         int decimals,
                                         Qt.WindowType[] f)
Static convenience function to get a floating point number from the user. title is the text which is displayed in the title bar of the dialog. label is the text which is shown to the user (it should say what should be entered). value is the default floating point number that the line edit will be set to. minValue and maxValue are the minimum and maximum values the user may choose, and decimals is the maximum number of decimal places the number may have.

If ok is non-null, *ok will be set to true if the user pressed OK and to false if the user pressed Cancel. The dialog's parent is parent. The dialog will be modal and uses the widget flags f.

This function returns the floating point number which has been entered by the user.

Use this static function like this:

The following code example is written in c++.

    bool ok;
    double d = QInputDialog::getDouble(this, tr("QInputDialog::getDouble()"),
                                       tr("Amount:"), 37.56, -10000, 10000, 2, &ok);
    if (ok)
        doubleLabel->setText(QString("$%1").arg(d));

See also:
getText(), getInteger(), and getItem().


getDouble

public static java.lang.Double getDouble(QWidget parent,
                                         java.lang.String title,
                                         java.lang.String label,
                                         double value,
                                         double minValue,
                                         double maxValue,
                                         int decimals)
This is a overloaded function provided for convenience.


getDouble

public static java.lang.Double getDouble(QWidget parent,
                                         java.lang.String title,
                                         java.lang.String label,
                                         double value,
                                         double minValue,
                                         double maxValue)
This is a overloaded function provided for convenience.


getDouble

public static java.lang.Double getDouble(QWidget parent,
                                         java.lang.String title,
                                         java.lang.String label,
                                         double value,
                                         double minValue)
This is a overloaded function provided for convenience.


getDouble

public static java.lang.Double getDouble(QWidget parent,
                                         java.lang.String title,
                                         java.lang.String label,
                                         double value)
This is a overloaded function provided for convenience.


getDouble

public static java.lang.Double getDouble(QWidget parent,
                                         java.lang.String title,
                                         java.lang.String label)
This is a overloaded function provided for convenience.


getInteger

public static java.lang.Integer getInteger(QWidget parent,
                                           java.lang.String title,
                                           java.lang.String label,
                                           int value,
                                           int minValue,
                                           int maxValue,
                                           int step,
                                           Qt.WindowFlags f)
Static convenience function to get an integer input from the user. title is the text which is displayed in the title bar of the dialog. label is the text which is shown to the user (it should say what should be entered). value is the default integer which the spinbox will be set to. minValue and maxValue are the minimum and maximum values the user may choose, and step is the amount by which the values change as the user presses the arrow buttons to increment or decrement the value.

If ok is non-null *ok will be set to true if the user pressed OK and to false if the user pressed Cancel. The dialog's parent is parent. The dialog will be modal and uses the widget flags f.

This function returns the integer which has been entered by the user.

Use this static function like this:

The following code example is written in c++.

    bool ok;
    int i = QInputDialog::getInteger(this, tr("QInputDialog::getInteger()"),
                                     tr("Percentage:"), 25, 0, 100, 1, &ok);
    if (ok)
        integerLabel->setText(tr("%1%").arg(i));

See also:
getText(), getDouble(), and getItem().


getInteger

public static java.lang.Integer getInteger(QWidget parent,
                                           java.lang.String title,
                                           java.lang.String label,
                                           int value,
                                           int minValue,
                                           int maxValue,
                                           int step,
                                           Qt.WindowType[] f)
Static convenience function to get an integer input from the user. title is the text which is displayed in the title bar of the dialog. label is the text which is shown to the user (it should say what should be entered). value is the default integer which the spinbox will be set to. minValue and maxValue are the minimum and maximum values the user may choose, and step is the amount by which the values change as the user presses the arrow buttons to increment or decrement the value.

If ok is non-null *ok will be set to true if the user pressed OK and to false if the user pressed Cancel. The dialog's parent is parent. The dialog will be modal and uses the widget flags f.

This function returns the integer which has been entered by the user.

Use this static function like this:

The following code example is written in c++.

    bool ok;
    int i = QInputDialog::getInteger(this, tr("QInputDialog::getInteger()"),
                                     tr("Percentage:"), 25, 0, 100, 1, &ok);
    if (ok)
        integerLabel->setText(tr("%1%").arg(i));

See also:
getText(), getDouble(), and getItem().


getInteger

public static java.lang.Integer getInteger(QWidget parent,
                                           java.lang.String title,
                                           java.lang.String label,
                                           int value,
                                           int minValue,
                                           int maxValue,
                                           int step)
This is a overloaded function provided for convenience.


getInteger

public static java.lang.Integer getInteger(QWidget parent,
                                           java.lang.String title,
                                           java.lang.String label,
                                           int value,
                                           int minValue,
                                           int maxValue)
This is a overloaded function provided for convenience.


getInteger

public static java.lang.Integer getInteger(QWidget parent,
                                           java.lang.String title,
                                           java.lang.String label,
                                           int value,
                                           int minValue)
This is a overloaded function provided for convenience.


getInteger

public static java.lang.Integer getInteger(QWidget parent,
                                           java.lang.String title,
                                           java.lang.String label,
                                           int value)
This is a overloaded function provided for convenience.


getInteger

public static java.lang.Integer getInteger(QWidget parent,
                                           java.lang.String title,
                                           java.lang.String label)
This is a overloaded function provided for convenience.


getItem

public static java.lang.String getItem(QWidget parent,
                                       java.lang.String title,
                                       java.lang.String label,
                                       java.util.List list,
                                       int current,
                                       boolean editable,
                                       Qt.WindowFlags f)
Static convenience function to let the user select an item from a string list. title is the text which is displayed in the title bar of the dialog. label is the text which is shown to the user (it should say what should be entered). list is the string list which is inserted into the combobox, and current is the number of the item which should be the current item. If editable is true the user can enter their own text; if editable is false the user may only select one of the existing items.

If ok is non-null *a ok will be set to true if the user pressed OK and to false if the user pressed Cancel. The dialog's parent is parent. The dialog will be modal and uses the widget flags f.

This function returns the text of the current item, or if editable is true, the current text of the combobox.

Use this static function like this:

The following code example is written in c++.

    QStringList items;
    items << tr("Spring") << tr("Summer") << tr("Fall") << tr("Winter");

    bool ok;
    QString item = QInputDialog::getItem(this, tr("QInputDialog::getItem()"),
                                         tr("Season:"), items, 0, false, &ok);
    if (ok && !item.isEmpty())
        itemLabel->setText(item);

See also:
getText(), getInteger(), and getDouble().


getItem

public static java.lang.String getItem(QWidget parent,
                                       java.lang.String title,
                                       java.lang.String label,
                                       java.util.List list,
                                       int current,
                                       boolean editable,
                                       Qt.WindowType[] f)
Static convenience function to let the user select an item from a string list. title is the text which is displayed in the title bar of the dialog. label is the text which is shown to the user (it should say what should be entered). list is the string list which is inserted into the combobox, and current is the number of the item which should be the current item. If editable is true the user can enter their own text; if editable is false the user may only select one of the existing items.

If ok is non-null *a ok will be set to true if the user pressed OK and to false if the user pressed Cancel. The dialog's parent is parent. The dialog will be modal and uses the widget flags f.

This function returns the text of the current item, or if editable is true, the current text of the combobox.

Use this static function like this:

The following code example is written in c++.

    QStringList items;
    items << tr("Spring") << tr("Summer") << tr("Fall") << tr("Winter");

    bool ok;
    QString item = QInputDialog::getItem(this, tr("QInputDialog::getItem()"),
                                         tr("Season:"), items, 0, false, &ok);
    if (ok && !item.isEmpty())
        itemLabel->setText(item);

See also:
getText(), getInteger(), and getDouble().


getItem

public static java.lang.String getItem(QWidget parent,
                                       java.lang.String title,
                                       java.lang.String label,
                                       java.util.List list,
                                       int current,
                                       boolean editable)
This is a overloaded function provided for convenience.


getItem

public static java.lang.String getItem(QWidget parent,
                                       java.lang.String title,
                                       java.lang.String label,
                                       java.util.List list,
                                       int current)
This is a overloaded function provided for convenience.


getItem

public static java.lang.String getItem(QWidget parent,
                                       java.lang.String title,
                                       java.lang.String label,
                                       java.util.List list)
This is a overloaded function provided for convenience.


getText

public static java.lang.String getText(QWidget parent,
                                       java.lang.String title,
                                       java.lang.String label,
                                       QLineEdit.EchoMode echo,
                                       java.lang.String text,
                                       Qt.WindowFlags f)
Static convenience function to get a string from the user. title is the text which is displayed in the title bar of the dialog. label is the text which is shown to the user (it should say what should be entered). text is the default text which is placed in the line edit. The mode is the echo mode the line edit will use. If ok is non-null *a ok will be set to true if the user pressed OK and to false if the user pressed Cancel. The dialog's parent is parent. The dialog will be modal and uses the widget flags f.

This function returns the text which has been entered in the line edit. It will not return an empty string.

Use this static function like this:

The following code example is written in c++.

    bool ok;
    QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"),
                                         tr("User name:"), QLineEdit::Normal,
                                         QDir::home().dirName(), &ok);
    if (ok && !text.isEmpty())
        textLabel->setText(text);

See also:
getInteger(), getDouble(), and getItem().


getText

public static java.lang.String getText(QWidget parent,
                                       java.lang.String title,
                                       java.lang.String label,
                                       QLineEdit.EchoMode echo,
                                       java.lang.String text,
                                       Qt.WindowType[] f)
Static convenience function to get a string from the user. title is the text which is displayed in the title bar of the dialog. label is the text which is shown to the user (it should say what should be entered). text is the default text which is placed in the line edit. The mode is the echo mode the line edit will use. If ok is non-null *a ok will be set to true if the user pressed OK and to false if the user pressed Cancel. The dialog's parent is parent. The dialog will be modal and uses the widget flags f.

This function returns the text which has been entered in the line edit. It will not return an empty string.

Use this static function like this:

The following code example is written in c++.

    bool ok;
    QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"),
                                         tr("User name:"), QLineEdit::Normal,
                                         QDir::home().dirName(), &ok);
    if (ok && !text.isEmpty())
        textLabel->setText(text);

See also:
getInteger(), getDouble(), and getItem().


getText

public static java.lang.String getText(QWidget parent,
                                       java.lang.String title,
                                       java.lang.String label,
                                       QLineEdit.EchoMode echo,
                                       java.lang.String text)
Static convenience function to get a string from the user. title is the text which is displayed in the title bar of the dialog. label is the text which is shown to the user (it should say what should be entered). text is the default text which is placed in the line edit. The mode is the echo mode the line edit will use. If ok is non-null *a ok will be set to true if the user pressed OK and to false if the user pressed Cancel. The dialog's parent is parent. The dialog will be modal and uses the widget flags f.

This function returns the text which has been entered in the line edit. It will not return an empty string.

Use this static function like this:

The following code example is written in c++.

    bool ok;
    QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"),
                                         tr("User name:"), QLineEdit::Normal,
                                         QDir::home().dirName(), &ok);
    if (ok && !text.isEmpty())
        textLabel->setText(text);

See also:
getInteger(), getDouble(), and getItem().


getText

public static java.lang.String getText(QWidget parent,
                                       java.lang.String title,
                                       java.lang.String label,
                                       QLineEdit.EchoMode echo)
Static convenience function to get a string from the user. title is the text which is displayed in the title bar of the dialog. label is the text which is shown to the user (it should say what should be entered). text is the default text which is placed in the line edit. The mode is the echo mode the line edit will use. If ok is non-null *a ok will be set to true if the user pressed OK and to false if the user pressed Cancel. The dialog's parent is parent. The dialog will be modal and uses the widget flags f.

This function returns the text which has been entered in the line edit. It will not return an empty string.

Use this static function like this:

The following code example is written in c++.

    bool ok;
    QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"),
                                         tr("User name:"), QLineEdit::Normal,
                                         QDir::home().dirName(), &ok);
    if (ok && !text.isEmpty())
        textLabel->setText(text);

See also:
getInteger(), getDouble(), and getItem().


getText

public static java.lang.String getText(QWidget parent,
                                       java.lang.String title,
                                       java.lang.String label)
This is a overloaded function provided for convenience.