diff options
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsproxywidget')
3 files changed, 69 insertions, 62 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/BLACKLIST index 20977b26bb..731b3ae253 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/BLACKLIST +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/BLACKLIST @@ -1,8 +1,6 @@ [scrollUpdate] android b2qt -[hoverEnterLeaveEvent] -macos ci [windowOpacity] macos ci [wheelEventPropagation] diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt index a1bf1270c2..f28ff74cfa 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt @@ -1,15 +1,22 @@ -# Generated from qgraphicsproxywidget.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qgraphicsproxywidget Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicsproxywidget LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicsproxywidget SOURCES tst_qgraphicsproxywidget.cpp DEFINES QTEST_QPA_MOUSE_HANDLING - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::Gui Qt::GuiPrivate diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 43522e325a..f14b7299b5 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> @@ -9,6 +9,8 @@ #include <private/qgraphicsproxywidget_p.h> #include <private/qlayoutengine_p.h> // qSmartMin functions... +#include <QtWidgets/private/qapplication_p.h> + Q_LOGGING_CATEGORY(lcTests, "qt.widgets.tests") /* @@ -333,7 +335,7 @@ void tst_QGraphicsProxyWidget::setWidget() widget->setStyle(style.data()); widget->setFont(QFont("Times")); widget->setVisible(true); - QApplication::setActiveWindow(widget); + QApplicationPrivate::setActiveWindow(widget); widget->activateWindow(); widget->setEnabled(true); widget->resize(325, 241); @@ -707,7 +709,6 @@ void tst_QGraphicsProxyWidget::focusNextPrevChild() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); - QApplication::setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); if (hasScene) { scene.addItem(proxyGuard.release()); @@ -749,7 +750,6 @@ void tst_QGraphicsProxyWidget::focusOutEvent() SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget; scene.addItem(proxy); view.show(); - QApplication::setActiveWindow(&view); view.activateWindow(); view.setFocus(); QVERIFY(QTest::qWaitForWindowActive(&view)); @@ -782,6 +782,9 @@ void tst_QGraphicsProxyWidget::focusOutEvent() void tst_QGraphicsProxyWidget::focusProxy_QTBUG_51856() { +#ifdef ANDROID + QSKIP("This test leads to failures on subsequent test cases, QTBUG-119574"); +#endif // QSpinBox has an internal QLineEdit; this QLineEdit has the spinbox // as its focus proxy. struct FocusedSpinBox : QSpinBox @@ -804,6 +807,9 @@ void tst_QGraphicsProxyWidget::focusProxy_QTBUG_51856() } }; + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("QWindow::requestActivate() is not supported."); + QGraphicsScene scene; QGraphicsView view(&scene); SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget; @@ -925,7 +931,6 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); - QApplication::setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget; @@ -940,7 +945,7 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent() proxy->setPos(50, 0); QSignalSpy sceneChangedSpy(&scene, &QGraphicsScene::changed); scene.addItem(proxy); - QTRY_VERIFY(sceneChangedSpy.count() > 0); + QTRY_VERIFY(sceneChangedSpy.size() > 0); // outside graphics item QTest::mouseMove(&view, QPoint(10, 10)); @@ -979,7 +984,6 @@ void tst_QGraphicsProxyWidget::keyPressEvent() QGraphicsView view(&scene); view.show(); view.viewport()->setFocus(); - QApplication::setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); QCOMPARE(QApplication::activeWindow(), (QWidget*)&view); @@ -1018,7 +1022,6 @@ void tst_QGraphicsProxyWidget::keyReleaseEvent() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); - QApplication::setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); QCOMPARE(QApplication::activeWindow(), (QWidget*)&view); @@ -1038,9 +1041,9 @@ void tst_QGraphicsProxyWidget::keyReleaseEvent() proxy->setFocus(); QTest::keyPress(view.viewport(), Qt::Key_Space); - QTRY_COMPARE(spy.count(), 0); + QTRY_COMPARE(spy.size(), 0); QTest::keyRelease(view.viewport(), Qt::Key_Space); - QTRY_COMPARE(spy.count(), hasWidget ? 1 : 0); + QTRY_COMPARE(spy.size(), hasWidget ? 1 : 0); } // protected void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) @@ -1064,11 +1067,10 @@ void tst_QGraphicsProxyWidget::mouseDoubleClickEvent() view.resize(100, 100); view.show(); - QApplication::setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); QCOMPARE(QApplication::activeWindow(), (QWidget*)&view); // wait for scene to be updated before doing any coordinate mappings on it - QTRY_VERIFY(sceneChangedSpy.count() > 0); + QTRY_VERIFY(sceneChangedSpy.size() > 0); QPoint pointInLineEdit = view.mapFromScene(proxy->mapToScene(15, proxy->boundingRect().center().y())); QTest::mousePress(view.viewport(), Qt::LeftButton, {}, pointInLineEdit); @@ -1109,13 +1111,13 @@ void tst_QGraphicsProxyWidget::mousePressReleaseEvent() proxy->setFocus(); // wait for scene to be updated before doing any coordinate mappings on it - QTRY_VERIFY(sceneChangedSpy.count() > 0); + QTRY_VERIFY(sceneChangedSpy.size() > 0); QPoint buttonCenter = view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center())); QTest::mousePress(view.viewport(), Qt::LeftButton, {}, buttonCenter); - QTRY_COMPARE(spy.count(), 0); + QTRY_COMPARE(spy.size(), 0); QTest::mouseRelease(view.viewport(), Qt::LeftButton, {}, buttonCenter); - QTRY_COMPARE(spy.count(), hasWidget ? 1 : 0); + QTRY_COMPARE(spy.size(), hasWidget ? 1 : 0); } void tst_QGraphicsProxyWidget::resizeEvent_data() @@ -1150,7 +1152,6 @@ void tst_QGraphicsProxyWidget::paintEvent() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); - QApplication::setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); QVERIFY(view.isActiveWindow()); @@ -1166,7 +1167,7 @@ void tst_QGraphicsProxyWidget::paintEvent() QSignalSpy sceneChangedSpy(&scene, &QGraphicsScene::changed); scene.addItem(&proxy); - QTRY_VERIFY(sceneChangedSpy.count() > 0); // make sure the scene is ready + QTRY_VERIFY(sceneChangedSpy.size() > 0); // make sure the scene is ready proxy.paintCount = 0; w->update(); @@ -1321,6 +1322,9 @@ static QList<QRect> rects(const QRegion ®ion) void tst_QGraphicsProxyWidget::scrollUpdate() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("QWindow::requestActivate() is not supported."); + ScrollWidget *widget = new ScrollWidget; QGraphicsScene scene; @@ -1534,7 +1538,6 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleWidget() window.setLayout(layout); window.show(); - QApplication::setActiveWindow(&window); window.activateWindow(); QVERIFY(QTest::qWaitForWindowActive(&window)); @@ -1618,7 +1621,6 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleTwoWidgets() window.setLayout(layout); window.show(); - QApplication::setActiveWindow(&window); window.activateWindow(); QVERIFY(QTest::qWaitForWindowActive(&window)); @@ -1751,7 +1753,6 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget() window.setLayout(layout); window.show(); - QApplication::setActiveWindow(&window); window.activateWindow(); QVERIFY(QTest::qWaitForWindowActive(&window)); @@ -1888,7 +1889,6 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets() window.setLayout(layout); window.show(); - QApplication::setActiveWindow(&window); window.activateWindow(); QVERIFY(QTest::qWaitForWindowActive(&window)); @@ -2062,7 +2062,7 @@ void tst_QGraphicsProxyWidget::setFocus_simpleWidget() window.setLayout(layout); window.show(); - QApplication::setActiveWindow(&window); + QApplicationPrivate::setActiveWindow(&window); window.activateWindow(); QVERIFY(QTest::qWaitForWindowActive(&window)); QCOMPARE(QApplication::activeWindow(), &window); @@ -2134,7 +2134,6 @@ void tst_QGraphicsProxyWidget::setFocus_simpleTwoWidgets() window.setLayout(layout); window.show(); - QApplication::setActiveWindow(&window); window.activateWindow(); QVERIFY(QTest::qWaitForWindowActive(&window)); QCOMPARE(QApplication::activeWindow(), &window); @@ -2213,7 +2212,6 @@ void tst_QGraphicsProxyWidget::setFocus_complexTwoWidgets() window.setLayout(layout); window.show(); - QApplication::setActiveWindow(&window); window.activateWindow(); QVERIFY(QTest::qWaitForWindowActive(&window)); QCOMPARE(QApplication::activeWindow(), &window); @@ -2305,7 +2303,7 @@ void tst_QGraphicsProxyWidget::popup_basic() box->setGeometry(0, 0, 320, 40); box->addItems(QStringList() << "monday" << "tuesday" << "wednesday" << "thursday" << "saturday" << "sunday"); - QCOMPARE(proxy->childItems().count(), 0); + QCOMPARE(proxy->childItems().size(), 0); proxy->setWidget(boxGuard.release()); proxy->show(); scene.addItem(proxy); @@ -2322,7 +2320,7 @@ void tst_QGraphicsProxyWidget::popup_basic() QTRY_COMPARE(box->pos(), QPoint()); - QCOMPARE(proxy->childItems().count(), 1); + QCOMPARE(proxy->childItems().size(), 1); QGraphicsProxyWidget *child = (QGraphicsProxyWidget*)(proxy->childItems())[0]; QVERIFY(child->isWidget()); QVERIFY(child->widget()); @@ -2402,7 +2400,7 @@ void tst_QGraphicsProxyWidget::changingCursor_basic() proxy->setWidget(widget); QSignalSpy sceneChangedSpy(&scene, &QGraphicsScene::changed); scene.addItem(proxy); - QTRY_VERIFY(sceneChangedSpy.count() > 0); // make sure the scene is ready + QTRY_VERIFY(sceneChangedSpy.size() > 0); // make sure the scene is ready // in QTest::mouseMove(view.viewport(), view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center()))); @@ -2458,7 +2456,7 @@ void tst_QGraphicsProxyWidget::tooltip_basic() QGraphicsView view(&scene); view.setFixedSize(200, 200); view.show(); - QApplication::setActiveWindow(&view); + QApplicationPrivate::setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); { QHelpEvent helpEvent(QEvent::ToolTip, view.viewport()->rect().topLeft(), @@ -2468,7 +2466,8 @@ void tst_QGraphicsProxyWidget::tooltip_basic() bool foundView = false; bool foundTipLabel = false; - foreach (QWidget *widget, QApplication::topLevelWidgets()) { + const auto widgets = QApplication::topLevelWidgets(); + for (QWidget *widget : widgets) { if (widget == &view) foundView = true; if (widget->inherits("QTipLabel")) @@ -2595,7 +2594,7 @@ void tst_QGraphicsProxyWidget::windowOpacity() QGraphicsProxyWidget *proxy = scene.addWidget(widget); proxy->setCacheMode(QGraphicsItem::ItemCoordinateCache); - QApplication::setActiveWindow(&view); + QApplicationPrivate::setActiveWindow(&view); view.show(); QVERIFY(QTest::qWaitForWindowActive(&view)); QVERIFY(view.isActiveWindow()); @@ -2620,7 +2619,7 @@ void tst_QGraphicsProxyWidget::windowOpacity() QTRY_COMPARE(eventSpy.counts[QEvent::UpdateRequest], 0); QTRY_COMPARE(eventSpy.counts[QEvent::Paint], paints); - QTRY_COMPARE(signalSpy.count(), 1); + QTRY_COMPARE(signalSpy.size(), 1); const QList<QVariant> arguments = signalSpy.takeFirst(); const QList<QRectF> updateRects = qvariant_cast<QList<QRectF> >(arguments.at(0)); QCOMPARE(updateRects.size(), 1); @@ -2895,10 +2894,10 @@ void tst_QGraphicsProxyWidget::createProxyForChildWidget() QTest::mousePress(view.viewport(), Qt::LeftButton, {}, view.mapFromScene(checkboxProxy->mapToScene(QPointF(8,8)))); - QTRY_COMPARE(spy.count(), 0); + QTRY_COMPARE(spy.size(), 0); QTest::mouseRelease(view.viewport(), Qt::LeftButton, {}, view.mapFromScene(checkboxProxy->mapToScene(QPointF(8,8)))); - QTRY_COMPARE(spy.count(), 1); + QTRY_COMPARE(spy.size(), 1); @@ -2993,7 +2992,7 @@ void tst_QGraphicsProxyWidget::actionsContextMenu() view.resize(200, 200); view.move(QGuiApplication::primaryScreen()->geometry().center() - QPoint(100, 100)); view.show(); - QApplication::setActiveWindow(&view); + QApplicationPrivate::setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); view.setFocus(); QTRY_VERIFY(view.hasFocus()); @@ -3063,6 +3062,9 @@ void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget_data() void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("QWindow::requestActivate() is not supported."); + QFETCH(bool, bypass); std::unique_ptr<QWidget> widgetGuard(new QWidget); @@ -3072,7 +3074,6 @@ void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); - QApplication::setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); QGraphicsProxyWidget *proxy = scene.addWidget(widgetGuard.release()); @@ -3276,6 +3277,9 @@ public: void tst_QGraphicsProxyWidget::inputMethod() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("QWindow::requestActivate() is not supported."); + QGraphicsScene scene; // check that the proxy is initialized with the correct input method sensitivity @@ -3335,7 +3339,6 @@ void tst_QGraphicsProxyWidget::clickFocus() view.setFrameStyle(0); view.resize(300, 300); view.show(); - QApplication::setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); QVERIFY(!proxy->hasFocus()); @@ -3479,7 +3482,6 @@ void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget() QGraphicsView view(&scene); view.resize(600, 600); - QApplication::setActiveWindow(&view); view.show(); QVERIFY(QTest::qWaitForWindowActive(&view)); @@ -3523,7 +3525,6 @@ void tst_QGraphicsProxyWidget::mapToGlobal() // QTBUG-41135 childWidget->resize(embeddedWidget->size() / 2); childWidget->move(embeddedWidget->width() / 4, embeddedWidget->height() / 4); // center in embeddedWidget scene.addWidget(embeddedWidget); - QApplication::setActiveWindow(&view); view.show(); QVERIFY(QTest::qWaitForWindowExposed(&view)); const QPoint embeddedCenter = embeddedWidget->rect().center(); @@ -3531,8 +3532,9 @@ void tst_QGraphicsProxyWidget::mapToGlobal() // QTBUG-41135 QCOMPARE(embeddedWidget->mapFromGlobal(embeddedCenterGlobal), embeddedCenter); // This should be equivalent to the view center give or take rounding // errors due to odd window margins + const int Tolerance = qCeil(4 * view.devicePixelRatio()); const QPoint viewCenter = view.geometry().center(); - QVERIFY2((viewCenter - embeddedCenterGlobal).manhattanLength() <= 3, + QVERIFY2((viewCenter - embeddedCenterGlobal).manhattanLength() <= Tolerance, msgPointMismatch(embeddedCenterGlobal, viewCenter).constData()); // Same test with child centered on embeddedWidget. Also make sure @@ -3542,7 +3544,7 @@ void tst_QGraphicsProxyWidget::mapToGlobal() // QTBUG-41135 const QPoint childCenter = childWidget->rect().center(); const QPoint childCenterGlobal = childWidget->mapToGlobal(childCenter); QCOMPARE(childWidget->mapFromGlobal(childCenterGlobal), childCenter); - QVERIFY2((viewCenter - childCenterGlobal).manhattanLength() <= 4, + QVERIFY2((viewCenter - childCenterGlobal).manhattanLength() <= Tolerance, msgPointMismatch(childCenterGlobal, viewCenter).constData()); } @@ -3687,27 +3689,27 @@ void tst_QGraphicsProxyWidget::wheelEventPropagation() // accepted by the embedded widget QCOMPARE(view.itemAt(wheelPosition), nullptr); wheelUp(Qt::NoScrollPhase); - QCOMPARE(scrollSpy.count(), ++scrollCount); + QCOMPARE(scrollSpy.size(), ++scrollCount); // wheeling on the label, which ignores the event, should scroll the view QCOMPARE(view.itemAt(wheelPosition), labelProxy); wheelUp(Qt::NoScrollPhase); - QCOMPARE(scrollSpy.count(), ++scrollCount); + QCOMPARE(scrollSpy.size(), ++scrollCount); QCOMPARE(view.itemAt(wheelPosition), labelProxy); wheelUp(Qt::NoScrollPhase); - QCOMPARE(scrollSpy.count(), ++scrollCount); + QCOMPARE(scrollSpy.size(), ++scrollCount); // left the widget QCOMPARE(view.itemAt(wheelPosition), nullptr); wheelUp(Qt::NoScrollPhase); - QCOMPARE(scrollSpy.count(), ++scrollCount); + QCOMPARE(scrollSpy.size(), ++scrollCount); // reached the nested widget, which accepts the wheel event, so no more scrolling QCOMPARE(view.itemAt(wheelPosition), nestedProxy); // remember this position for later const int scrollBarValueOnNestedProxy = view.verticalScrollBar()->value(); wheelUp(Qt::NoScrollPhase); - QCOMPARE(scrollSpy.count(), scrollCount); + QCOMPARE(scrollSpy.size(), scrollCount); QCOMPARE(nestedWidget->wheelEventCount, 1); // reset, try with kinetic events @@ -3718,41 +3720,41 @@ void tst_QGraphicsProxyWidget::wheelEventPropagation() // no matter if the widget accepts wheel events - the view has the grab QCOMPARE(view.itemAt(wheelPosition), nullptr); wheelUp(Qt::ScrollBegin); - QCOMPARE(scrollSpy.count(), ++scrollCount); + QCOMPARE(scrollSpy.size(), ++scrollCount); for (int i = 0; i < 5; ++i) { wheelUp(Qt::ScrollUpdate); - QCOMPARE(scrollSpy.count(), ++scrollCount); + QCOMPARE(scrollSpy.size(), ++scrollCount); } wheelUp(Qt::ScrollEnd); - QCOMPARE(scrollSpy.count(), ++scrollCount); + QCOMPARE(scrollSpy.size(), ++scrollCount); // reset view.verticalScrollBar()->setValue(0); - scrollCount = scrollSpy.count(); + scrollCount = scrollSpy.size(); // starting a scroll on a widget that doesn't accept wheel events // should also scroll the view, which still gets the grab wheelUp(Qt::NoScrollPhase); - scrollCount = scrollSpy.count(); + scrollCount = scrollSpy.size(); QCOMPARE(view.itemAt(wheelPosition), labelProxy); wheelUp(Qt::ScrollBegin); - QCOMPARE(scrollSpy.count(), ++scrollCount); + QCOMPARE(scrollSpy.size(), ++scrollCount); for (int i = 0; i < 5; ++i) { wheelUp(Qt::ScrollUpdate); - QCOMPARE(scrollSpy.count(), ++scrollCount); + QCOMPARE(scrollSpy.size(), ++scrollCount); } wheelUp(Qt::ScrollEnd); - QCOMPARE(scrollSpy.count(), ++scrollCount); + QCOMPARE(scrollSpy.size(), ++scrollCount); // starting a scroll on a widget that does accept wheel events // should not scroll the view view.verticalScrollBar()->setValue(scrollBarValueOnNestedProxy); - scrollCount = scrollSpy.count(); + scrollCount = scrollSpy.size(); QCOMPARE(view.itemAt(wheelPosition), nestedProxy); wheelUp(Qt::ScrollBegin); - QCOMPARE(scrollSpy.count(), scrollCount); + QCOMPARE(scrollSpy.size(), scrollCount); } #endif // QT_CONFIG(wheelevent) @@ -3850,7 +3852,7 @@ void tst_QGraphicsProxyWidget::touchEventPropagation() QHash<int, QList<TouchRecord>> records; QWidget *mousePressReceiver = nullptr; - int count(int id = 0) const { return records.value(id).count(); } + int count(int id = 0) const { return records.value(id).size(); } TouchRecord at(int i, int id = 0) const { return records.value(id).at(i); } void clear() { @@ -3954,7 +3956,7 @@ void tst_QGraphicsProxyWidget::touchEventPropagation() QCOMPARE(record.receiver, view.windowHandle()); QCOMPARE(record.eventType, QEvent::TouchEnd); QCOMPARE(eventSpy.mousePressReceiver, pushButton1); - QCOMPARE(clickedSpy.count(), 1); + QCOMPARE(clickedSpy.size(), 1); eventSpy.clear(); clickedSpy.clear(); @@ -4022,7 +4024,7 @@ void tst_QGraphicsProxyWidget::touchEventPropagation() QCOMPARE(eventSpy.at(0, 3).receiver, touchWidget2); QCOMPARE(eventSpy.at(1, 3).receiver, touchWidget2); QCOMPARE(eventSpy.at(2, 3).receiver, touchWidget2); - QCOMPARE(clickedSpy.count(), 0); // multi-touch event does not synthesize a mouse event + QCOMPARE(clickedSpy.size(), 0); // multi-touch event does not synthesize a mouse event } QTEST_MAIN(tst_QGraphicsProxyWidget) |