|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QDialog
com.trolltech.qt.gui.QInputDialog
public class QInputDialog
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.
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.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.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 |
---|
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.
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.
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.
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.
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.
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 |
---|
public QInputDialog(QWidget parent, Qt.WindowType[] flags)
public QInputDialog(QWidget parent)
public QInputDialog()
public QInputDialog(QWidget parent, Qt.WindowFlags flags)
Method Detail |
---|
public final java.lang.String cancelButtonText()
public final java.util.List comboBoxItems()
public final int doubleDecimals()
QDoubleSpinBox::setDecimals()
.
public final double doubleMaximum()
DoubleInput
mode.
public final double doubleMinimum()
DoubleInput
mode.
public final double doubleValue()
DoubleInput
mode.
public final QInputDialog.InputMode inputMode()
public final int intMaximum()
IntInput
mode.
public final int intMinimum()
IntInput
mode.
public final int intStep()
IntInput
mode.
public final int intValue()
IntInput
mode.
public final boolean isComboBoxEditable()
public final java.lang.String labelText()
public final java.lang.String okButtonText()
public final QInputDialog.InputDialogOptions options()
setOption()
, and testOption()
.
public final void setCancelButtonText(java.lang.String text)
public final void setComboBoxEditable(boolean editable)
public final void setComboBoxItems(java.util.List items)
public final void setDoubleDecimals(int decimals)
QDoubleSpinBox::setDecimals()
.
public final void setDoubleMaximum(double max)
DoubleInput
mode.
public final void setDoubleMinimum(double min)
DoubleInput
mode.
public final void setDoubleRange(double min, double max)
DoubleInput
mode, with minimum and maximum values specified by min and max respectively.
public final void setDoubleValue(double value)
DoubleInput
mode.
public final void setInputMode(QInputDialog.InputMode mode)
public final void setIntMaximum(int max)
IntInput
mode.
public final void setIntMinimum(int min)
IntInput
mode.
public final void setIntRange(int min, int max)
IntInput
mode, with minimum and maximum values specified by min and max respectively.
public final void setIntStep(int step)
IntInput
mode.
public final void setIntValue(int value)
IntInput
mode.
public final void setLabelText(java.lang.String text)
public final void setOkButtonText(java.lang.String text)
public final void setOption(QInputDialog.InputDialogOption option)
options
, and testOption()
.
public final void setOption(QInputDialog.InputDialogOption option, boolean on)
options
, and testOption()
.
public final void setOptions(QInputDialog.InputDialogOption[] options)
public final void setOptions(QInputDialog.InputDialogOptions options)
setOption()
, and testOption()
.
public final void setTextEchoMode(QLineEdit.EchoMode mode)
TextInput
mode.
public final void setTextValue(java.lang.String text)
TextInput
mode.
public final boolean testOption(QInputDialog.InputDialogOption option)
options
, and setOption()
.
public final QLineEdit.EchoMode textEchoMode()
TextInput
mode.
public final java.lang.String textValue()
TextInput
mode.
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)
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)
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)
public static final java.lang.Integer getInt(QWidget parent, java.lang.String title, java.lang.String label, int value, int min, int max)
public static final java.lang.Integer getInt(QWidget parent, java.lang.String title, java.lang.String label, int value)
public static final java.lang.Integer getInt(QWidget parent, java.lang.String title, java.lang.String label)
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)
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));
getText()
, getInteger()
, and getItem()
.
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)
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));
getText()
, getInteger()
, and getItem()
.
public static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue, double maxValue, int decimals)
public static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue, double maxValue)
public static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue)
public static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label, double value)
public static java.lang.Double getDouble(QWidget parent, java.lang.String title, java.lang.String label)
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)
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));
getText()
, getDouble()
, and getItem()
.
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)
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));
getText()
, getDouble()
, and getItem()
.
public static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue, int maxValue, int step)
public static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue, int maxValue)
public static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue)
public static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label, int value)
public static java.lang.Integer getInteger(QWidget parent, java.lang.String title, java.lang.String label)
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)
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);
getText()
, getInteger()
, and getDouble()
.
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)
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);
getText()
, getInteger()
, and getDouble()
.
public static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List list, int current, boolean editable)
public static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List list, int current)
public static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List list)
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)
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);
getInteger()
, getDouble()
, and getItem()
.
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)
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);
getInteger()
, getDouble()
, and getItem()
.
public static java.lang.String getText(QWidget parent, java.lang.String title, java.lang.String label, QLineEdit.EchoMode echo, java.lang.String text)
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);
getInteger()
, getDouble()
, and getItem()
.
public static java.lang.String getText(QWidget parent, java.lang.String title, java.lang.String label, QLineEdit.EchoMode echo)
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);
getInteger()
, getDouble()
, and getItem()
.
public static java.lang.String getText(QWidget parent, java.lang.String title, java.lang.String label)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |