summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorPekka Vuorela <pvuorela@iki.fi>2012-09-04 00:32:29 +0300
committerQt by Nokia <qt-info@nokia.com>2012-09-11 09:35:28 +0200
commite06999bd625c8e787d429a1296739a68e48a4e6f (patch)
tree76ab97cce1508a5922619e94078b01231165a082 /tests/auto/gui
parentc3523bdde753daefd421e2ce228f0da0b70051ac (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/gui')
-rw-r--r--tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp28
1 files changed, 7 insertions, 21 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()