diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-05-19 16:19:44 +1000 |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-05-19 17:22:19 +1000 |
commit | d774fc5f255fdd2443bd82a5fd87f4e4756e8a1b (patch) | |
tree | aaa7b0ff98850af7d00bea1ee7fca3c7de0b6c16 /tests/auto/declarative/qsgtextinput | |
parent | af5facf92d521cbfca9ceed50cce4b39b8f3d304 (diff) |
Link item focus to canvas widget focus.
Change-Id: I7da1db30819c80b48f4c285a43274b668c686826
Diffstat (limited to 'tests/auto/declarative/qsgtextinput')
-rw-r--r-- | tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp | 12 |
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); |