summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/util/qmlview.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/declarative/util/qmlview.cpp b/src/declarative/util/qmlview.cpp
index 98642e9..f932e4a 100644
--- a/src/declarative/util/qmlview.cpp
+++ b/src/declarative/util/qmlview.cpp
@@ -538,7 +538,11 @@ void QmlView::resizeEvent(QResizeEvent *e)
d->root->setWidth(width());
d->root->setHeight(height());
}
- setSceneRect(QRectF(0, 0, d->root->width(), d->root->height()));
+ if (d->root) {
+ setSceneRect(QRectF(0, 0, d->root->width(), d->root->height()));
+ } else {
+ setSceneRect(rect());
+ }
QGraphicsView::resizeEvent(e);
}