Adjust to the changes in the QInputMethodQuery event.
authorLars Knoll <lars.knoll@nokia.com>
Thu, 8 Sep 2011 12:41:51 +0000 (14:41 +0200)
committerLars Knoll <lars.knoll@nokia.com>
Thu, 8 Sep 2011 12:47:48 +0000 (14:47 +0200)
Change-Id: I0c160f7635c87f63990ddc519cbc966ccab65f4a
Reviewed-on: http://codereview.qt-project.org/4447
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>

src/declarative/items/qsgitem.cpp

index d3b3e0b..addb046 100644 (file)
@@ -4904,8 +4904,15 @@ bool QSGItem::event(QEvent *ev)
 #endif
     if (ev->type() == QEvent::InputMethodQuery) {
         QInputMethodQueryEvent *query = static_cast<QInputMethodQueryEvent *>(ev);
-        query->setValue(inputMethodQuery(query->query()));
-        ev->accept();
+        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();
         return true;
     } else if (ev->type() == QEvent::InputMethod) {
         inputMethodEvent(static_cast<QInputMethodEvent *>(ev));