summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>2012-01-23 13:09:14 +0200
committerQt by Nokia <qt-info@nokia.com>2012-01-27 13:28:03 +0100
commit1166ad8603fe4fbd1b008aaa7c043ee1078780a5 (patch)
tree1dadf8ef4160a2abaf7c5f020042d4cfc5905af9 /tests
parentdd565d2d4c7e9b766bc9f575d803ebaad71b33b7 (diff)
QWidgets to use QGuiApplication focus object change notifications
Moving away from deprecated QInputPanel inputItem. Small behavioral changes: - On focus proxy widgets, disabling WA_InputMethodEnabled on proxy will no longer disable input method for proxy target. - setEnabled(false) on proxy widget will no longer disable input method for target as a special case. Change-Id: Ifb5b7144d29bd3aefdde7cf4a0bd396db06e67e2 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 4d0bd6621c..cd019f4536 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -8889,6 +8889,8 @@ void tst_QWidget::inputFocus_task257832()
QLineEdit *widget = new QLineEdit;
widget->setFocus();
widget->winId(); // make sure, widget has been created
+ widget->show();
+ QTRY_VERIFY(widget->hasFocus());
QCOMPARE(qApp->inputPanel()->inputItem(), static_cast<QWidget*>(widget));
widget->setReadOnly(true);
QVERIFY(!qApp->inputPanel()->inputItem());
@@ -9028,16 +9030,10 @@ void tst_QWidget::focusProxyAndInputMethods()
// otherwise input method queries go to the wrong widget
QCOMPARE(qApp->inputPanel()->inputItem(), toplevel);
- child->setAttribute(Qt::WA_InputMethodEnabled, false);
+ toplevel->setAttribute(Qt::WA_InputMethodEnabled, false);
QVERIFY(!qApp->inputPanel()->inputItem());
- child->setAttribute(Qt::WA_InputMethodEnabled, true);
- QCOMPARE(qApp->inputPanel()->inputItem(), toplevel);
-
- child->setEnabled(false);
- QVERIFY(!qApp->inputPanel()->inputItem());
-
- child->setEnabled(true);
+ toplevel->setAttribute(Qt::WA_InputMethodEnabled, true);
QCOMPARE(qApp->inputPanel()->inputItem(), toplevel);
delete toplevel;