summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2009-10-01 09:10:24 (GMT)
committerChristian Kamm <christian.d.kamm@nokia.com>2009-10-01 09:12:30 (GMT)
commitba35af80f0a73bd6b839e54645999a889b53e4b4 (patch)
treeb98eee2fb6d063981d34e8be5924c40577095903 /src/declarative
parent27e89da6ec97020a7a664be5be0b474aba323712 (diff)
downloadQt-ba35af80f0a73bd6b839e54645999a889b53e4b4.zip
Qt-ba35af80f0a73bd6b839e54645999a889b53e4b4.tar.gz
Qt-ba35af80f0a73bd6b839e54645999a889b53e4b4.tar.bz2
Only set QmlViewer's scene to the root element size if there is one.
Reviewed-by: erikv Reviewed-by: kkoehne
Diffstat (limited to 'src/declarative')
-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);
}