summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qmlview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/util/qmlview.cpp')
-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 805612e..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(rect());
+ if (d->root) {
+ setSceneRect(QRectF(0, 0, d->root->width(), d->root->height()));
+ } else {
+ setSceneRect(rect());
+ }
QGraphicsView::resizeEvent(e);
}