summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals@canonical.com>2015-02-17 09:53:27 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-02-17 13:47:16 +0000
commit8fccfef424e7d2b7a2019b1f828234145d4011df (patch)
tree008d8cc883fb2a7e3981250dab4826cb66db9858 /tests
parent732c99487682f0be0b201deb1adf697f6d323b00 (diff)
Make sure there's a scene before using it
Fixes crash hovering links in quassel Task-number: QTBUG-44509 Change-Id: I77d8d9118ad185ed70a46e91445e2960200e562b Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 5aea845f90..3913f204ba 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -175,6 +175,7 @@ private slots:
void windowFrameMargins();
void QTBUG_6986_sendMouseEventToAlienWidget();
void mapToGlobal();
+ void mapToGlobalWithoutScene();
void QTBUG_43780_visibility();
};
@@ -3690,6 +3691,16 @@ void tst_QGraphicsProxyWidget::mapToGlobal() // QTBUG-41135
.arg(embeddedCenterGlobal.x()).arg(embeddedCenterGlobal.y())));
}
+void tst_QGraphicsProxyWidget::mapToGlobalWithoutScene() // QTBUG-44509
+{
+ QGraphicsProxyWidget proxyWidget;
+ QWidget *embeddedWidget = new QWidget;
+ proxyWidget.setWidget(embeddedWidget);
+ const QPoint localPos(0, 0);
+ const QPoint globalPos = embeddedWidget->mapToGlobal(localPos);
+ QCOMPARE(embeddedWidget->mapFromGlobal(globalPos), localPos);
+}
+
// QTBUG_43780: Embedded widgets have isWindow()==true but showing them should not
// trigger the top-level widget code path of show() that closes all popups
// (for example combo popups).