summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qinputdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/dialogs/qinputdialog.cpp')
-rw-r--r--src/gui/dialogs/qinputdialog.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp
index 1947a08..f13b8f5 100644
--- a/src/gui/dialogs/qinputdialog.cpp
+++ b/src/gui/dialogs/qinputdialog.cpp
@@ -1136,6 +1136,8 @@ void QInputDialog::done(int result)
be entered).
\a text is the default text which is placed in the line edit.
\a mode is the echo mode the line edit will use.
+ \a inputMethodHints is the input method hints that will be used in the
+ edit widget if an input method is active.
If \a ok is nonnull \e *\a ok will be set to true if the user pressed
\gui OK and to false if the user pressed \gui Cancel. The dialog's parent
@@ -1158,13 +1160,14 @@ void QInputDialog::done(int result)
QString QInputDialog::getText(QWidget *parent, const QString &title, const QString &label,
QLineEdit::EchoMode mode, const QString &text, bool *ok,
- Qt::WindowFlags flags)
+ Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
{
QInputDialog dialog(parent, flags);
dialog.setWindowTitle(title);
dialog.setLabelText(label);
dialog.setTextValue(text);
dialog.setTextEchoMode(mode);
+ dialog.setInputMethodHints(inputMethodHints);
int ret = dialog.exec();
if (ok)
@@ -1177,6 +1180,17 @@ QString QInputDialog::getText(QWidget *parent, const QString &title, const QStri
}
/*!
+ \internal
+*/
+// ### Qt 5: Use only the version above.
+QString QInputDialog::getText(QWidget *parent, const QString &title, const QString &label,
+ QLineEdit::EchoMode mode, const QString &text, bool *ok,
+ Qt::WindowFlags flags)
+{
+ return getText(parent, title, label, mode, text, ok, flags, Qt::ImhNone);
+}
+
+/*!
\since 4.5
Static convenience function to get an integer input from the user.
@@ -1286,6 +1300,8 @@ double QInputDialog::getDouble(QWidget *parent, const QString &title, const QStr
be entered).
\a items is the string list which is inserted into the combobox.
\a current is the number of the item which should be the current item.
+ \a inputMethodHints is the input method hints that will be used if the
+ combobox is editable and an input method is active.
If \a editable is true the user can enter their own text; otherwise the
user may only select one of the existing items.
@@ -1310,7 +1326,7 @@ double QInputDialog::getDouble(QWidget *parent, const QString &title, const QStr
QString QInputDialog::getItem(QWidget *parent, const QString &title, const QString &label,
const QStringList &items, int current, bool editable, bool *ok,
- Qt::WindowFlags flags)
+ Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
{
QString text(items.value(current));
@@ -1320,6 +1336,7 @@ QString QInputDialog::getItem(QWidget *parent, const QString &title, const QStri
dialog.setComboBoxItems(items);
dialog.setTextValue(text);
dialog.setComboBoxEditable(editable);
+ dialog.setInputMethodHints(inputMethodHints);
int ret = dialog.exec();
if (ok)
@@ -1332,6 +1349,17 @@ QString QInputDialog::getItem(QWidget *parent, const QString &title, const QStri
}
/*!
+ \internal
+*/
+// ### Qt 5: Use only the version above.
+QString QInputDialog::getItem(QWidget *parent, const QString &title, const QString &label,
+ const QStringList &items, int current, bool editable, bool *ok,
+ Qt::WindowFlags flags)
+{
+ return getItem(parent, title, label, items, current, editable, ok, flags, Qt::ImhNone);
+}
+
+/*!
\obsolete
Use getInt() instead.