From 1166ad8603fe4fbd1b008aaa7c043ee1078780a5 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Mon, 23 Jan 2012 13:09:14 +0200 Subject: 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 --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'tests') 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(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; -- cgit v1.2.3