summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-19 01:12:33 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-19 01:12:33 (GMT)
commit8a7de547942c9a660dfc45c176ea1a3027bbf99a (patch)
treeac1eaa76630f7bbc2fc3165c2c209d2a973fd929 /tests
parentde300d7a41b0e428ba11e6061c39580c54012dc9 (diff)
parent7c2b43a5c824ed4d5493c233d84222be9f5865c3 (diff)
downloadQt-8a7de547942c9a660dfc45c176ea1a3027bbf99a.zip
Qt-8a7de547942c9a660dfc45c176ea1a3027bbf99a.tar.gz
Qt-8a7de547942c9a660dfc45c176ea1a3027bbf99a.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: (203 commits) Fix compilation of OpenVG. Fixed wrong qmake logic for Symbian. Fixed a bug where a proxy widget received FocusIn over and over. Fixed broken test. Fixed recursive QMAKE_EXTRA_TARGETS for symbian makefiles. Fix dependency so it works also on massive parrallel systems Set PM_MenuScrollerHeight to zero Change QS60Style to use combobox popup menu This should likely get webkit linking again on windows/sbsv2 Handle Symbian's file name encoding, correctly. Fix linking issues of QtOpenVG.dll Fixed Symbian applications with DESTDIR set. Removed a warning about generated rss files. Revert "Temporarily disable problematic dll." Fixed "Cannot install protected application" message on Symbian. Worked around a crash in the elf2e32 postlinker tool. Worked around case differences in Symbian^3 and Gnupoc. Enabled compilation of plugins again. Make sure target path exists in qmake_extra_pre_targetdep.flm Added close button to Anomaly demo browser ...
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp145
-rw-r--r--tests/auto/xmlpatterns.pro1
2 files changed, 84 insertions, 62 deletions
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 69d2ad2..23b3458 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -3426,85 +3426,106 @@ void tst_QGraphicsProxyWidget::clickFocus()
scene.setItemIndexMethod(QGraphicsScene::NoIndex);
QGraphicsProxyWidget *proxy = scene.addWidget(new QLineEdit);
- EventSpy proxySpy(proxy);
- EventSpy widgetSpy(proxy->widget());
-
QGraphicsView view(&scene);
- view.setFrameStyle(0);
- view.resize(300, 300);
- view.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&view);
-#endif
- QApplication::setActiveWindow(&view);
- QTest::qWait(25);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
- QVERIFY(!proxy->hasFocus());
- QVERIFY(!proxy->widget()->hasFocus());
+ {
+ EventSpy proxySpy(proxy);
+ EventSpy widgetSpy(proxy->widget());
- QCOMPARE(proxySpy.counts[QEvent::FocusIn], 0);
- QCOMPARE(proxySpy.counts[QEvent::FocusOut], 0);
- QCOMPARE(widgetSpy.counts[QEvent::FocusIn], 0);
- QCOMPARE(widgetSpy.counts[QEvent::FocusOut], 0);
+ view.setFrameStyle(0);
+ view.resize(300, 300);
+ view.show();
+#ifdef Q_WS_X11
+ qt_x11_wait_for_window_manager(&view);
+#endif
+ QApplication::setActiveWindow(&view);
+ QTest::qWait(25);
+ QTRY_COMPARE(QApplication::activeWindow(), &view);
- QPointF lineEditCenter = proxy->mapToScene(proxy->boundingRect().center());
- // Spontaneous mouse click sets focus on a clickable widget.
- for (int retry = 0; retry < 50 && !proxy->hasFocus(); retry++)
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(lineEditCenter));
- QVERIFY(proxy->hasFocus());
- QVERIFY(proxy->widget()->hasFocus());
- QCOMPARE(proxySpy.counts[QEvent::FocusIn], 1);
- QCOMPARE(widgetSpy.counts[QEvent::FocusIn], 1);
+ QVERIFY(!proxy->hasFocus());
+ QVERIFY(!proxy->widget()->hasFocus());
- scene.setFocusItem(0);
- QVERIFY(!proxy->hasFocus());
- QVERIFY(!proxy->widget()->hasFocus());
- QCOMPARE(proxySpy.counts[QEvent::FocusOut], 1);
- QCOMPARE(widgetSpy.counts[QEvent::FocusOut], 1);
+ QCOMPARE(proxySpy.counts[QEvent::FocusIn], 0);
+ QCOMPARE(proxySpy.counts[QEvent::FocusOut], 0);
+ QCOMPARE(widgetSpy.counts[QEvent::FocusIn], 0);
+ QCOMPARE(widgetSpy.counts[QEvent::FocusOut], 0);
- // Non-spontaneous mouse click sets focus if the widget has been clicked before
- {
- QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
- event.setScenePos(lineEditCenter);
- event.setButton(Qt::LeftButton);
- qApp->sendEvent(&scene, &event);
+ QPointF lineEditCenter = proxy->mapToScene(proxy->boundingRect().center());
+ // Spontaneous mouse click sets focus on a clickable widget.
+ for (int retry = 0; retry < 50 && !proxy->hasFocus(); retry++)
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(lineEditCenter));
QVERIFY(proxy->hasFocus());
QVERIFY(proxy->widget()->hasFocus());
- QCOMPARE(proxySpy.counts[QEvent::FocusIn], 2);
- QCOMPARE(widgetSpy.counts[QEvent::FocusIn], 2);
+ QCOMPARE(proxySpy.counts[QEvent::FocusIn], 1);
+ QCOMPARE(widgetSpy.counts[QEvent::FocusIn], 1);
+
+ scene.setFocusItem(0);
+ QVERIFY(!proxy->hasFocus());
+ QVERIFY(!proxy->widget()->hasFocus());
+ QCOMPARE(proxySpy.counts[QEvent::FocusOut], 1);
+ QCOMPARE(widgetSpy.counts[QEvent::FocusOut], 1);
+
+ // Non-spontaneous mouse click sets focus if the widget has been clicked before
+ {
+ QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
+ event.setScenePos(lineEditCenter);
+ event.setButton(Qt::LeftButton);
+ qApp->sendEvent(&scene, &event);
+ QVERIFY(proxy->hasFocus());
+ QVERIFY(proxy->widget()->hasFocus());
+ QCOMPARE(proxySpy.counts[QEvent::FocusIn], 2);
+ QCOMPARE(widgetSpy.counts[QEvent::FocusIn], 2);
+ }
}
scene.setFocusItem(0);
proxy->setWidget(new QLineEdit); // resets focusWidget
- QVERIFY(!proxy->hasFocus());
- QVERIFY(!proxy->widget()->hasFocus());
- QCOMPARE(proxySpy.counts[QEvent::FocusOut], 2);
- QCOMPARE(widgetSpy.counts[QEvent::FocusOut], 2);
- // Non-spontaneous mouse click does not set focus on the embedded widget.
{
- QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
- event.setScenePos(lineEditCenter);
- event.setButton(Qt::LeftButton);
- qApp->sendEvent(&scene, &event);
+ QPointF lineEditCenter = proxy->mapToScene(proxy->boundingRect().center());
+ EventSpy proxySpy(proxy);
+ EventSpy widgetSpy(proxy->widget());
QVERIFY(!proxy->hasFocus());
QVERIFY(!proxy->widget()->hasFocus());
- QCOMPARE(proxySpy.counts[QEvent::FocusIn], 2);
- QCOMPARE(widgetSpy.counts[QEvent::FocusIn], 2);
- }
+ QCOMPARE(proxySpy.counts[QEvent::FocusOut], 0);
+ QCOMPARE(widgetSpy.counts[QEvent::FocusOut], 0);
- scene.setFocusItem(0);
- QVERIFY(!proxy->hasFocus());
- QVERIFY(!proxy->widget()->hasFocus());
- QCOMPARE(proxySpy.counts[QEvent::FocusOut], 2);
- QCOMPARE(widgetSpy.counts[QEvent::FocusOut], 2);
-
- // Spontaneous click on non-clickable widget does not give focus.
- proxy->widget()->setFocusPolicy(Qt::NoFocus);
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(lineEditCenter));
- QVERIFY(!proxy->hasFocus());
- QVERIFY(!proxy->widget()->hasFocus());
+ // Non-spontaneous mouse click does not set focus on the embedded widget.
+ {
+ QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
+ event.setScenePos(lineEditCenter);
+ event.setButton(Qt::LeftButton);
+ qApp->sendEvent(&scene, &event);
+ QVERIFY(!proxy->hasFocus());
+ QVERIFY(!proxy->widget()->hasFocus());
+ QCOMPARE(proxySpy.counts[QEvent::FocusIn], 0);
+ QCOMPARE(widgetSpy.counts[QEvent::FocusIn], 0);
+ }
+
+ scene.setFocusItem(0);
+ QVERIFY(!proxy->hasFocus());
+ QVERIFY(!proxy->widget()->hasFocus());
+ QCOMPARE(proxySpy.counts[QEvent::FocusOut], 0);
+ QCOMPARE(widgetSpy.counts[QEvent::FocusOut], 0);
+
+ // Spontaneous click on non-clickable widget does not give focus.
+ proxy->widget()->setFocusPolicy(Qt::NoFocus);
+ 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);
+ }
}
void tst_QGraphicsProxyWidget::windowFrameMargins()
diff --git a/tests/auto/xmlpatterns.pro b/tests/auto/xmlpatterns.pro
index f670266..923f2c4 100644
--- a/tests/auto/xmlpatterns.pro
+++ b/tests/auto/xmlpatterns.pro
@@ -37,6 +37,7 @@ xmlpatternsdiagnosticsts.depends = xmlpatternssdk
xmlpatternsview.depends = xmlpatternssdk
xmlpatternsxslts.depends = xmlpatternssdk
xmlpatternsschemats.depends = xmlpatternssdk
+xmlpatternsxqts.depends = xmlpatternssdk
!contains(QT_CONFIG, private_tests): SUBDIRS -= \
xmlpatternsdiagnosticsts \