summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_p.h
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2009-11-11 16:58:45 (GMT)
committerJoerg Bornemann <joerg.bornemann@nokia.com>2009-11-11 16:58:45 (GMT)
commit6462303c56349045ce4a9517a7882215b2da929e (patch)
tree69e3c21a2bbae2cb1180f2b5f32913e088f5dfa9 /src/gui/kernel/qwidget_p.h
parentb111d0bb1f0483d507c758810a0f247cb8dd82c0 (diff)
downloadQt-6462303c56349045ce4a9517a7882215b2da929e.zip
Qt-6462303c56349045ce4a9517a7882215b2da929e.tar.gz
Qt-6462303c56349045ce4a9517a7882215b2da929e.tar.bz2
fix crash in QWidgetPrivate::screenGeometry
Missing null check added. Not really a Windows CE only crash. The following code crashed on all platforms, because the QGraphicsProxyWidget had no scene yet. QPushButton *button = new QPushButton; QGraphicsProxyWidget *buttonProxy = new QGraphicsProxyWidget; buttonProxy->setWidget(button); qApp->desktop()->screenGeometry(button); Task-number: QTBUG-5626 Reviewed-by: Alessandro Portale
Diffstat (limited to 'src/gui/kernel/qwidget_p.h')
-rw-r--r--src/gui/kernel/qwidget_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index df28bac..eea929b 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -479,7 +479,7 @@ public:
QGraphicsProxyWidget *ancestorProxy = widget->d_func()->nearestGraphicsProxyWidget(widget);
//It's embedded if it has an ancestor
if (ancestorProxy) {
- if (!bypassGraphicsProxyWidget(widget)) {
+ if (!bypassGraphicsProxyWidget(widget) && ancestorProxy->scene() != 0) {
// One view, let be smart and return the viewport rect then the popup is aligned
if (ancestorProxy->scene()->views().size() == 1) {
QGraphicsView *view = ancestorProxy->scene()->views().at(0);