diff options
author | Pekka Vuorela <pvuorela@iki.fi> | 2012-09-04 00:32:29 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-11 09:35:28 +0200 |
commit | e06999bd625c8e787d429a1296739a68e48a4e6f (patch) | |
tree | 76ab97cce1508a5922619e94078b01231165a082 /tests/auto | |
parent | c3523bdde753daefd421e2ce228f0da0b70051ac (diff) |
Remove deprecated inputItem and inputWindow from QInputMethod
Interfaces introduced and deprecated during Qt5 development.
Change-Id: I804a02df8c4a03ed6558f4a86375f97d09513d5c
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp | 28 | ||||
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 27 |
2 files changed, 8 insertions, 47 deletions
diff --git a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp index 1b468847b2..6b52f70375 100644 --- a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp +++ b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp @@ -113,7 +113,6 @@ private slots: void isVisible(); void animating(); void keyboarRectangle(); - void inputItem(); void inputItemTransform(); void cursorRectangle(); void invokeAction(); @@ -178,20 +177,6 @@ void tst_qinputmethod::keyboarRectangle() QCOMPARE(spy.count(), 1); } -void tst_qinputmethod::inputItem() -{ - QVERIFY(!qApp->inputMethod()->inputItem()); - QSignalSpy spy(qApp->inputMethod(), SIGNAL(inputItemChanged())); - - qApp->inputMethod()->setInputItem(&m_inputItem); - - QCOMPARE(qApp->inputMethod()->inputItem(), &m_inputItem); - QCOMPARE(spy.count(), 1); - - // reset - qApp->inputMethod()->setInputItem(0); -} - void tst_qinputmethod::inputItemTransform() { QCOMPARE(qApp->inputMethod()->inputItemTransform(), QTransform()); @@ -214,13 +199,18 @@ void tst_qinputmethod::cursorRectangle() { QCOMPARE(qApp->inputMethod()->cursorRectangle(), QRectF()); + DummyWindow window; + window.show(); + QVERIFY(QTest::qWaitForWindowExposed(&window)); + window.requestActivateWindow(); + QTRY_COMPARE(qApp->focusWindow(), &window); + window.setFocusObject(&m_inputItem); + QTransform transform; transform.translate(10, 10); transform.scale(2, 2); transform.shear(2, 2); qApp->inputMethod()->setInputItemTransform(transform); - qApp->inputMethod()->setInputItem(&m_inputItem); - QCOMPARE(qApp->inputMethod()->cursorRectangle(), transform.mapRect(QRectF(1, 2, 3, 4))); m_inputItem.cursorRectangle = QRectF(1.5, 2, 1, 8); @@ -228,7 +218,6 @@ void tst_qinputmethod::cursorRectangle() // reset m_inputItem.cursorRectangle = QRectF(1, 2, 3, 4); - qApp->inputMethod()->setInputItem(0); qApp->inputMethod()->setInputItemTransform(QTransform()); } @@ -278,9 +267,6 @@ void tst_qinputmethod::update() QCOMPARE(int(m_platformInputContext.m_lastQueries), int(Qt::ImQueryAll)); QCOMPARE(qApp->inputMethod()->keyboardRectangle(), QRectF(10, 20, 30, 40)); - - // reset - qApp->inputMethod()->setInputItem(0); } void tst_qinputmethod::query() diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index ad6bde7b70..d41bd856a3 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -352,7 +352,6 @@ private slots: void initialPosForDontShowOnScreenWidgets(); void updateOnDestroyedSignal(); void toplevelLineEditFocus(); - void inputFocus_task257832(); void focusWidget_task254563(); #ifndef Q_OS_WINCE_WM @@ -8869,18 +8868,6 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779() } #endif -void tst_QWidget::inputFocus_task257832() -{ - QScopedPointer<QLineEdit> widget(new QLineEdit); - widget->setFocus(); - widget->winId(); // make sure, widget has been created - widget->show(); - QTRY_VERIFY(widget->hasFocus()); - QCOMPARE(qApp->inputMethod()->inputItem(), widget.data()); - widget->setReadOnly(true); - QVERIFY(!qApp->inputMethod()->inputItem()); -} - void tst_QWidget::setGraphicsEffect() { // Check that we don't have any effect by default. @@ -9004,19 +8991,7 @@ void tst_QWidget::focusProxyAndInputMethods() QVERIFY(QTest::qWaitForWindowActive(toplevel.data())); QVERIFY(toplevel->hasFocus()); QVERIFY(child->hasFocus()); - - // verify that toggling input methods on the child widget - // correctly propagate to the focus proxy's input method - // and that the input method gets the focus proxy passed - // as the focus widget instead of the child widget. - // otherwise input method queries go to the wrong widget - QCOMPARE(qApp->inputMethod()->inputItem(), toplevel.data()); - - toplevel->setAttribute(Qt::WA_InputMethodEnabled, false); - QVERIFY(!qApp->inputMethod()->inputItem()); - - toplevel->setAttribute(Qt::WA_InputMethodEnabled, true); - QCOMPARE(qApp->inputMethod()->inputItem(), toplevel.data()); + QCOMPARE(qApp->focusObject(), toplevel.data()); } #ifdef QT_BUILD_INTERNAL |