diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-09-08 14:37:22 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-09-08 14:47:39 +0200 |
commit | b002e21d15ec8ecf6455c75055c6ca3112d5f756 (patch) | |
tree | ac7ed8a89a50b4d881bad0f29da9ab5c22cae37c /src/widgets/kernel | |
parent | 49bb37e05d9b7047a80c93667d43657395bdec73 (diff) |
Change the QInputMethodQueryEvent to be able to query a set of properties
The event now takes a Qt::InputMethodQueries bitfield. Like this the
editor can set all properties in one go on the event instead of
having to process many query events.
Change-Id: Ifd9d7328a9fce0c21625371ec744ea2090e163be
Reviewed-on: http://codereview.qt-project.org/4448
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 125e33f0da..76544d2524 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -8358,9 +8358,14 @@ bool QWidget::event(QEvent *event) case QEvent::InputMethodQuery: if (testAttribute(Qt::WA_InputMethodEnabled)) { QInputMethodQueryEvent *query = static_cast<QInputMethodQueryEvent *>(event); - QVariant v = inputMethodQuery(query->query()); - - query->setValue(v); + Qt::InputMethodQueries queries = query->queries(); + for (uint i = 0; i < 32; ++i) { + Qt::InputMethodQuery q = (Qt::InputMethodQuery)(int)(queries & (1<<i)); + if (q) { + QVariant v = inputMethodQuery(q); + query->setValue(q, v); + } + } query->accept(); break; } |