summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/qml/qmlruntime.cpp10
-rw-r--r--tools/qml/qmlruntime.h3
2 files changed, 8 insertions, 5 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
diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h
index cb1b438..cec3204 100644
--- a/tools/qml/qmlruntime.h
+++ b/tools/qml/qmlruntime.h
@@ -102,7 +102,6 @@ public:
void addPluginPath(const QString& plugin);
void setUseGL(bool use);
void setUseNativeFileBrowser(bool);
- void updateSizeHints();
void setSizeToView(bool sizeToView);
QDeclarativeView *view() const;
@@ -145,6 +144,8 @@ private slots:
void warningsWidgetOpened();
void warningsWidgetClosed();
+ void updateSizeHints();
+
private:
QString getVideoFileName();