diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-28 06:56:24 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-28 06:56:24 (GMT) |
commit | 369f899e69362b2156800f8c90dfb0bdbe5f2598 (patch) | |
tree | ae5b78fa15d63f3b2764224cd3ad0b6f9e51a7fc /tests/auto | |
parent | 4d848478706e1a32eb0d85e222ba029f68a768d7 (diff) | |
parent | 0da153d47da2dcc59b33bc47ea949ceaf3189579 (diff) | |
download | Qt-369f899e69362b2156800f8c90dfb0bdbe5f2598.zip Qt-369f899e69362b2156800f8c90dfb0bdbe5f2598.tar.gz Qt-369f899e69362b2156800f8c90dfb0bdbe5f2598.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Active window focus gain should not open virtual keypad
Use QElapsedTimer rather than QTime::elapsed()
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp | 13 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 13 |
2 files changed, 22 insertions, 4 deletions
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 0df28d0..d3e3c3a 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -915,9 +915,18 @@ void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent() edit.setFocus(false); QCOMPARE(ic.openInputPanelReceived, false); QCOMPARE(ic.closeInputPanelReceived, true); + ic.closeInputPanelReceived = false; + + // active window focus reason should not cause input panel to open + QGraphicsObject * editObject = qobject_cast<QGraphicsObject*>(&edit); + editObject->setFocus(Qt::ActiveWindowFocusReason); + QCOMPARE(ic.openInputPanelReceived, false); + QCOMPARE(ic.closeInputPanelReceived, false); + + // and input panel should not open if focus has already been set edit.setFocus(true); - QCOMPARE(ic.openInputPanelReceived, true); - QCOMPARE(ic.closeInputPanelReceived, true); + QCOMPARE(ic.openInputPanelReceived, false); + QCOMPARE(ic.closeInputPanelReceived, false); edit.setShowInputPanelOnFocus(true); QCOMPARE(inputPanelonFocusSpy.count(),2); diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 155223d..c01cfa5 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -819,9 +819,18 @@ void tst_qdeclarativetextinput::sendRequestSoftwareInputPanelEvent() input.setFocus(false); QCOMPARE(ic.openInputPanelReceived, false); QCOMPARE(ic.closeInputPanelReceived, true); + ic.closeInputPanelReceived = false; + + // active window focus reason should not cause input panel to open + QGraphicsObject * inputObject = qobject_cast<QGraphicsObject*>(&input); + inputObject->setFocus(Qt::ActiveWindowFocusReason); + QCOMPARE(ic.openInputPanelReceived, false); + QCOMPARE(ic.closeInputPanelReceived, false); + + // and input panel should not open if focus has already been set input.setFocus(true); - QCOMPARE(ic.openInputPanelReceived, true); - QCOMPARE(ic.closeInputPanelReceived, true); + QCOMPARE(ic.openInputPanelReceived, false); + QCOMPARE(ic.closeInputPanelReceived, false); input.setShowInputPanelOnFocus(true); QCOMPARE(inputPanelonFocusSpy.count(),2); |