diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2009-11-11 16:58:45 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2009-11-11 16:58:45 (GMT) |
commit | 6462303c56349045ce4a9517a7882215b2da929e (patch) | |
tree | 69e3c21a2bbae2cb1180f2b5f32913e088f5dfa9 /src/gui/kernel | |
parent | b111d0bb1f0483d507c758810a0f247cb8dd82c0 (diff) | |
download | Qt-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')
-rw-r--r-- | src/gui/kernel/qwidget_p.h | 2 |
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); |