summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
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 /src/widgets/kernel
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 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 68715413d1..cb2e9e0bec 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -12272,7 +12272,7 @@ QPoint QWidget::mapToGlobal(const QPoint &pos) const
{
#ifndef QT_NO_GRAPHICSVIEW
Q_D(const QWidget);
- if (d->extra && d->extra->proxyWidget) {
+ if (d->extra && d->extra->proxyWidget && d->extra->proxyWidget->scene()) {
const QList <QGraphicsView *> views = d->extra->proxyWidget->scene()->views();
if (!views.isEmpty()) {
const QPointF scenePos = d->extra->proxyWidget->mapToScene(pos);
@@ -12307,7 +12307,7 @@ QPoint QWidget::mapFromGlobal(const QPoint &pos) const
{
#ifndef QT_NO_GRAPHICSVIEW
Q_D(const QWidget);
- if (d->extra && d->extra->proxyWidget) {
+ if (d->extra && d->extra->proxyWidget && d->extra->proxyWidget->scene()) {
const QList <QGraphicsView *> views = d->extra->proxyWidget->scene()->views();
if (!views.isEmpty()) {
const QPoint viewPortPos = views.first()->viewport()->mapFromGlobal(pos);