summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-05-05 04:57:53 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2010-05-07 00:59:27 (GMT)
commit7c945e152c9abd0478bed5a4d251012944d93b44 (patch)
tree4edc61eaf52e44485db237ead602f0871726c2d5 /src/declarative
parent35e6100977e496a242c41f6f0fc66889e7cd49fc (diff)
downloadQt-7c945e152c9abd0478bed5a4d251012944d93b44.zip
Qt-7c945e152c9abd0478bed5a4d251012944d93b44.tar.gz
Qt-7c945e152c9abd0478bed5a4d251012944d93b44.tar.bz2
Resize qmlruntime window to new dimensions when orientation changes
Task-number: Reviewed-by: Warwick Allison
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/util/qdeclarativeview.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index 62d913c..833e284 100644
--- a/src/declarative/util/qdeclarativeview.cpp
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -484,10 +484,7 @@ QSize QDeclarativeViewPrivate::rootObjectSize()
QSize rootObjectSize(0,0);
int widthCandidate = -1;
int heightCandidate = -1;
- if (declarativeItemRoot) {
- widthCandidate = declarativeItemRoot->width();
- heightCandidate = declarativeItemRoot->height();
- } else if (root) {
+ if (root) {
QSizeF size = root->boundingRect().size();
widthCandidate = size.width();
heightCandidate = size.height();
@@ -614,16 +611,15 @@ bool QDeclarativeView::eventFilter(QObject *watched, QEvent *e)
/*!
\internal
- Preferred size follows the root object in
- resize mode SizeViewToRootObject and
- the view in resize mode SizeRootObjectToView.
+ Preferred size follows the root object geometry.
*/
QSize QDeclarativeView::sizeHint() const
{
- if (d->resizeMode == SizeRootObjectToView) {
+ QSize rootObjectSize = d->rootObjectSize();
+ if (rootObjectSize.isEmpty()) {
return size();
- } else { // d->resizeMode == SizeViewToRootObject
- return d->rootObjectSize();
+ } else {
+ return rootObjectSize;
}
}