summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativetextedit
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-05-26 06:26:19 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2010-05-26 06:28:39 (GMT)
commit1256a212460438462367b48de086ab690f722be5 (patch)
tree110b43dfab0e3bb00d324fe33c8c07dc842ab1ac /tests/auto/declarative/qdeclarativetextedit
parent3449d4594f312728926ac83ae8453bba40434bbd (diff)
downloadQt-1256a212460438462367b48de086ab690f722be5.zip
Qt-1256a212460438462367b48de086ab690f722be5.tar.gz
Qt-1256a212460438462367b48de086ab690f722be5.tar.bz2
Open input panel on press if TextInput or TextEdit are already focused but panel has been closed
Task-number: Reviewed-by: Martin Jones
Diffstat (limited to 'tests/auto/declarative/qdeclarativetextedit')
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
index 2b6f2aa..0df28d0 100644
--- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
+++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -858,6 +858,7 @@ void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent()
// focus on press, input panel on focus
QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
QApplication::processEvents();
+ QVERIFY(edit.hasFocus());
QCOMPARE(ic.openInputPanelReceived, true);
QCOMPARE(ic.closeInputPanelReceived, false);
ic.openInputPanelReceived = false;
@@ -868,6 +869,14 @@ void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent()
QCOMPARE(ic.closeInputPanelReceived, false);
ic.openInputPanelReceived = false;
+ // Even with focus already gained, user needs
+ // to be able to open panel by pressing on the editor
+ QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, true);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+ ic.openInputPanelReceived = false;
+
// input panel closed on focus lost
edit.setFocus(false);
QApplication::processEvents();