summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-05-06 09:06:50 (GMT)
committeraxis <qt-info@nokia.com>2009-05-06 09:06:50 (GMT)
commite2e708b6a6a63e1f774624a30535c2b4de686ecd (patch)
tree6025261a7e0ccba5f27b498b4b3ac0fe02b7ae15 /src
parentab7578d954c6b5ff496316246cab3644d6f688f1 (diff)
parent7e6dd153858710282ddcb526e413226c3b7db833 (diff)
downloadQt-e2e708b6a6a63e1f774624a30535c2b4de686ecd.zip
Qt-e2e708b6a6a63e1f774624a30535c2b4de686ecd.tar.gz
Qt-e2e708b6a6a63e1f774624a30535c2b4de686ecd.tar.bz2
Merge branch 'virtualKeyboardAPI' into imHintsForS60
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qnamespace.h19
-rw-r--r--src/gui/kernel/qwidget.cpp15
2 files changed, 22 insertions, 12 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 1475b2e..e0ca27c 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1401,15 +1401,16 @@ public:
enum InputMethodHint {
ImhNone = 0x0,
ImhHiddenText = 0x1,
- ImhNumbersOnly = 0x2,
- ImhUppercaseOnly = 0x4,
- ImhLowercaseOnly = 0x8,
- ImhNoAutoUppercase = 0x10,
- ImhPreferNumbers = 0x20,
- ImhPreferUppercase = 0x40,
- ImhPreferLowercase = 0x80,
- ImhNoPredictiveText = 0x100,
- ImhDialableCharactersOnly = 0x200
+ ImhDigitsOnly = 0x2,
+ ImhFormattedNumbersOnly = 0x4,
+ ImhUppercaseOnly = 0x8,
+ ImhLowercaseOnly = 0x10,
+ ImhNoAutoUppercase = 0x20,
+ ImhPreferNumbers = 0x40,
+ ImhPreferUppercase = 0x80,
+ ImhPreferLowercase = 0x100,
+ ImhNoPredictiveText = 0x200,
+ ImhDialableCharactersOnly = 0x400
};
Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint)
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 64aeab5..19fdfbf 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -8478,11 +8478,14 @@ QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const
This is only relevant for input widgets. It is used by
the input method to retrieve hints as to how the input method
- should operate. For example, if the Qt::ImhNumbersOnly flag is
- set, the input method may change its visual components to reflect
+ should operate. For example, if the Qt::ImhFormattedNumbersOnly flag
+ is set, the input method may change its visual components to reflect
that only numbers can be entered.
- The effect may vary between input method implementations.
+ \note The flags are only hints, so the particular input method
+ implementation is free to ignore them. If you want to be
+ sure that a certain type of characters are entered,
+ you should also set a QValidator on the widget.
\since 4.6
@@ -8498,6 +8501,12 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints)
{
Q_D(QWidget);
d->imHints = hints;
+ // Optimisation to update input context only it has already been created.
+ if (d->ic || qApp->d_func()->inputContext) {
+ QInputContext *ic = inputContext();
+ if (ic)
+ ic->update();
+ }
}