summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-03-09 14:32:05 (GMT)
committeraxis <qt-info@nokia.com>2010-03-18 07:53:43 (GMT)
commite483886bcfcf7252af9ac7cc89de15f912bf69da (patch)
treee2282912c00717b7632570f07a9b8cc02ba77a96 /tests
parent05c20cbf719746f295ac4c3ebb484ea6c3555d70 (diff)
downloadQt-e483886bcfcf7252af9ac7cc89de15f912bf69da.zip
Qt-e483886bcfcf7252af9ac7cc89de15f912bf69da.tar.gz
Qt-e483886bcfcf7252af9ac7cc89de15f912bf69da.tar.bz2
Fixed a bug where a proxy widget received FocusIn over and over.
This also fixed the issue where an input panel would not be requested by the widget, because it thought it was being focused over and over, instead of focused, and then clicked (focus followed by click is default input panel popup behavior on Symbian). AutoTest: Included and passed RevBy: yoann RevBy: Jan-Arve
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 17311e2..23b3458 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -3513,6 +3513,18 @@ void tst_QGraphicsProxyWidget::clickFocus()
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(lineEditCenter));
QVERIFY(!proxy->hasFocus());
QVERIFY(!proxy->widget()->hasFocus());
+
+ // Multiple clicks should only result in one FocusIn.
+ proxy->widget()->setFocusPolicy(Qt::StrongFocus);
+ scene.setFocusItem(0);
+ QVERIFY(!proxy->hasFocus());
+ QVERIFY(!proxy->widget()->hasFocus());
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(lineEditCenter));
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(lineEditCenter));
+ QVERIFY(proxy->hasFocus());
+ QVERIFY(proxy->widget()->hasFocus());
+ QCOMPARE(widgetSpy.counts[QEvent::FocusIn], 1);
+ QCOMPARE(proxySpy.counts[QEvent::FocusIn], 1);
}
}