diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2009-10-01 09:10:24 (GMT) |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2009-10-01 09:12:30 (GMT) |
commit | ba35af80f0a73bd6b839e54645999a889b53e4b4 (patch) | |
tree | b98eee2fb6d063981d34e8be5924c40577095903 /src/declarative/util | |
parent | 27e89da6ec97020a7a664be5be0b474aba323712 (diff) | |
download | Qt-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/util')
-rw-r--r-- | src/declarative/util/qmlview.cpp | 6 |
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); } |