|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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 final 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(), getInteger(), getDouble() and getItem(). All the functions can be used in a similar way, for example:
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.
Dialogs Example
Nested Class Summary |
---|
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.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.gui.QDialog |
---|
accepted, finished, rejected |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Method Summary | |
---|---|
static QInputDialog |
fromNativePointer(QNativePointer nativePointer)
This function returns the QInputDialog instance pointed to by nativePointer |
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)
This is a overloaded function provided for convenience. |
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)
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<java.lang.String> 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<java.lang.String> 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<java.lang.String> 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<java.lang.String> 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<java.lang.String> list,
int current,
boolean editable,
Qt.WindowType... f)
This is a overloaded function provided for convenience. |
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)
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,
java.lang.String text)
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,
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)
This is a overloaded function provided for convenience. |
Methods inherited from class com.trolltech.qt.gui.QDialog |
---|
accept, adjustPosition, closeEvent, contextMenuEvent, done, eventFilter, exec, isSizeGripEnabled, keyPressEvent, minimumSizeHint, reject, resizeEvent, result, setModal, setResult, setSizeGripEnabled, setVisible, showEvent, sizeHint |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
disconnect, disconnect, signalSender |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Method Detail |
---|
public static QInputDialog fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.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)
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.
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)
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)
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.
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)
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<java.lang.String> list, int current, boolean editable, Qt.WindowFlags f)
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 combo box.
public static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List<java.lang.String> list, int current, boolean editable, Qt.WindowType... f)
public static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List<java.lang.String> list, int current, boolean editable)
public static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List<java.lang.String> list, int current)
public static java.lang.String getItem(QWidget parent, java.lang.String title, java.lang.String label, java.util.List<java.lang.String> 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)
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.
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)
public static java.lang.String getText(QWidget parent, java.lang.String title, java.lang.String label, QLineEdit.EchoMode echo, java.lang.String text)
public static java.lang.String getText(QWidget parent, java.lang.String title, java.lang.String label, QLineEdit.EchoMode echo)
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 |