From ba35af80f0a73bd6b839e54645999a889b53e4b4 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Thu, 1 Oct 2009 11:10:24 +0200 Subject: Only set QmlViewer's scene to the root element size if there is one. Reviewed-by: erikv Reviewed-by: kkoehne --- src/declarative/util/qmlview.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } -- cgit v0.12