aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qsgtextinput
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-05-19 16:19:44 +1000
committerMartin Jones <martin.jones@nokia.com>2011-05-19 17:22:19 +1000
commitd774fc5f255fdd2443bd82a5fd87f4e4756e8a1b (patch)
treeaaa7b0ff98850af7d00bea1ee7fca3c7de0b6c16 /tests/auto/declarative/qsgtextinput
parentaf5facf92d521cbfca9ceed50cce4b39b8f3d304 (diff)
Link item focus to canvas widget focus.
Diffstat (limited to 'tests/auto/declarative/qsgtextinput')
-rw-r--r--tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
index 015c47712a..1239abd0cf 100644
--- a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
+++ b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
@@ -2197,7 +2197,11 @@ void tst_qsgtextinput::preeditAutoScroll()
QSGView view(QUrl::fromLocalFile(SRCDIR "/data/preeditAutoScroll.qml"));
MyInputContext ic;
+ // QSGCanvas won't set the Qt::WA_InputMethodEnabled flag unless a suitable item has active focus
+ // and QWidget won't allow an input context to be set when the flag is not set.
+ view.setAttribute(Qt::WA_InputMethodEnabled, true);
view.setInputContext(&ic);
+ view.setAttribute(Qt::WA_InputMethodEnabled, false);
view.show();
QApplication::setActiveWindow(&view);
QTest::qWaitForWindowShown(&view);
@@ -2262,7 +2266,11 @@ void tst_qsgtextinput::preeditMicroFocus()
QSGView view(QUrl::fromLocalFile(SRCDIR "/data/inputMethodEvent.qml"));
MyInputContext ic;
+ // QSGCanvas won't set the Qt::WA_InputMethodEnabled flag unless a suitable item has active focus
+ // and QWidget won't allow an input context to be set when the flag is not set.
+ view.setAttribute(Qt::WA_InputMethodEnabled, true);
view.setInputContext(&ic);
+ view.setAttribute(Qt::WA_InputMethodEnabled, false);
view.show();
QApplication::setActiveWindow(&view);
QTest::qWaitForWindowShown(&view);
@@ -2314,7 +2322,11 @@ void tst_qsgtextinput::inputContextMouseHandler()
QSGView view(QUrl::fromLocalFile(SRCDIR "/data/inputContext.qml"));
MyInputContext ic;
+ // QSGCanvas won't set the Qt::WA_InputMethodEnabled flag unless a suitable item has active focus
+ // and QWidget won't allow an input context to be set when the flag is not set.
+ view.setAttribute(Qt::WA_InputMethodEnabled, true);
view.setInputContext(&ic);
+ view.setAttribute(Qt::WA_InputMethodEnabled, false);
view.show();
QApplication::setActiveWindow(&view);
QTest::qWaitForWindowShown(&view);