summaryrefslogtreecommitdiffstats
path: root/tools/qml/qmlruntime.cpp
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@nokia.com>2010-06-24 16:37:32 (GMT)
committerKai Koehne <kai.koehne@nokia.com>2010-06-25 06:41:15 (GMT)
commit9768a42358d1908701347d52887a964574b1b9b4 (patch)
treee7846dc8ae257d0d1843faef528b0221617f16b9 /tools/qml/qmlruntime.cpp
parent7294f46ec0c5ea07e438c45a069a618ceb6e17a9 (diff)
downloadQt-9768a42358d1908701347d52887a964574b1b9b4.zip
Qt-9768a42358d1908701347d52887a964574b1b9b4.tar.gz
Qt-9768a42358d1908701347d52887a964574b1b9b4.tar.bz2
fix QML Viewer resize modes
Diffstat (limited to 'tools/qml/qmlruntime.cpp')
-rw-r--r--tools/qml/qmlruntime.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index 3a8af60..109de7d 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -937,8 +937,8 @@ void QDeclarativeViewer::statusChanged()
if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) {
if (!isFullScreen() && !isMaximized()) {
canvas->setFixedSize(initialSize);
- resize(1, 1); // workaround for QMainWindowLayout NOT shrinking the window if the centralWidget() shrinks
- updateSizeHints();
+ resize(1, 1); // workaround for QMainWindowLayout NOT shrinking the window if the centralWidget() shrink
+ QTimer::singleShot(0, this, SLOT(updateSizeHints()));
}
}
}
@@ -1328,7 +1328,8 @@ void QDeclarativeViewer::orientationChanged()
if (canvas->rootObject()) {
QSizeF rootObjectSize = canvas->rootObject()->boundingRect().size();
if (size() != rootObjectSize.toSize()) {
- canvas->setFixedSize(rootObjectSize.toSize());
+ canvas->setMinimumSize(rootObjectSize.toSize());
+ canvas->resize(rootObjectSize.toSize());
resize(1, 1); // workaround for QMainWindowLayout NOT shrinking the window if the centralWidget() shrinks
}
}
@@ -1384,7 +1385,8 @@ void QDeclarativeViewer::updateSizeHints()
if (canvas->resizeMode() == QDeclarativeView::SizeViewToRootObject) {
QSize newWindowSize = canvas->sizeHint();
if (!isFullScreen() && !isMaximized()) {
- canvas->setFixedSize(newWindowSize);
+ canvas->setMinimumSize(newWindowSize);
+ canvas->resize(newWindowSize);
resize(1, 1); // workaround for QMainWindowLayout NOT shrinking the window if the centralWidget() shrinks
}
} else { // QDeclarativeView::SizeRootObjectToView