summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp28
1 files changed, 6 insertions, 22 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 4562ac3a84..ee1a8c530a 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>
@@ -709,7 +709,6 @@ void tst_QGraphicsProxyWidget::focusNextPrevChild()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
if (hasScene) {
scene.addItem(proxyGuard.release());
@@ -751,7 +750,6 @@ void tst_QGraphicsProxyWidget::focusOutEvent()
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
scene.addItem(proxy);
view.show();
- QApplicationPrivate::setActiveWindow(&view);
view.activateWindow();
view.setFocus();
QVERIFY(QTest::qWaitForWindowActive(&view));
@@ -784,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
@@ -930,7 +931,6 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
@@ -984,7 +984,6 @@ void tst_QGraphicsProxyWidget::keyPressEvent()
QGraphicsView view(&scene);
view.show();
view.viewport()->setFocus();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), (QWidget*)&view);
@@ -1023,7 +1022,6 @@ void tst_QGraphicsProxyWidget::keyReleaseEvent()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), (QWidget*)&view);
@@ -1069,7 +1067,6 @@ void tst_QGraphicsProxyWidget::mouseDoubleClickEvent()
view.resize(100, 100);
view.show();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), (QWidget*)&view);
// wait for scene to be updated before doing any coordinate mappings on it
@@ -1155,7 +1152,6 @@ void tst_QGraphicsProxyWidget::paintEvent()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
QVERIFY(view.isActiveWindow());
@@ -1542,7 +1538,6 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleWidget()
window.setLayout(layout);
window.show();
- QApplicationPrivate::setActiveWindow(&window);
window.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&window));
@@ -1626,7 +1621,6 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleTwoWidgets()
window.setLayout(layout);
window.show();
- QApplicationPrivate::setActiveWindow(&window);
window.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&window));
@@ -1759,7 +1753,6 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget()
window.setLayout(layout);
window.show();
- QApplicationPrivate::setActiveWindow(&window);
window.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&window));
@@ -1896,7 +1889,6 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets()
window.setLayout(layout);
window.show();
- QApplicationPrivate::setActiveWindow(&window);
window.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&window));
@@ -2070,7 +2062,6 @@ void tst_QGraphicsProxyWidget::setFocus_simpleWidget()
window.setLayout(layout);
window.show();
- QApplicationPrivate::setActiveWindow(&window);
window.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&window));
QCOMPARE(QApplication::activeWindow(), &window);
@@ -2142,7 +2133,6 @@ void tst_QGraphicsProxyWidget::setFocus_simpleTwoWidgets()
window.setLayout(layout);
window.show();
- QApplicationPrivate::setActiveWindow(&window);
window.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&window));
QCOMPARE(QApplication::activeWindow(), &window);
@@ -2221,7 +2211,6 @@ void tst_QGraphicsProxyWidget::setFocus_complexTwoWidgets()
window.setLayout(layout);
window.show();
- QApplicationPrivate::setActiveWindow(&window);
window.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&window));
QCOMPARE(QApplication::activeWindow(), &window);
@@ -2466,7 +2455,6 @@ void tst_QGraphicsProxyWidget::tooltip_basic()
QGraphicsView view(&scene);
view.setFixedSize(200, 200);
view.show();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
{
QHelpEvent helpEvent(QEvent::ToolTip, view.viewport()->rect().topLeft(),
@@ -2476,7 +2464,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"))
@@ -3001,7 +2990,6 @@ void tst_QGraphicsProxyWidget::actionsContextMenu()
view.resize(200, 200);
view.move(QGuiApplication::primaryScreen()->geometry().center() - QPoint(100, 100));
view.show();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
view.setFocus();
QTRY_VERIFY(view.hasFocus());
@@ -3083,7 +3071,6 @@ void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
QGraphicsProxyWidget *proxy = scene.addWidget(widgetGuard.release());
@@ -3349,7 +3336,6 @@ void tst_QGraphicsProxyWidget::clickFocus()
view.setFrameStyle(0);
view.resize(300, 300);
view.show();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
QVERIFY(!proxy->hasFocus());
@@ -3493,7 +3479,6 @@ void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget()
QGraphicsView view(&scene);
view.resize(600, 600);
- QApplicationPrivate::setActiveWindow(&view);
view.show();
QVERIFY(QTest::qWaitForWindowActive(&view));
@@ -3537,7 +3522,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);
- QApplicationPrivate::setActiveWindow(&view);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
const QPoint embeddedCenter = embeddedWidget->rect().center();