summaryrefslogtreecommitdiffstats
path: root/tools/qmlviewer/qmlviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qmlviewer/qmlviewer.cpp')
-rw-r--r--tools/qmlviewer/qmlviewer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp
index 73aae44..b115abb 100644
--- a/tools/qmlviewer/qmlviewer.cpp
+++ b/tools/qmlviewer/qmlviewer.cpp
@@ -310,6 +310,7 @@ QmlViewer::QmlViewer(QWidget *parent, Qt::WindowFlags flags)
canvas->setFocus();
QObject::connect(canvas, SIGNAL(sceneResized(QSize)), this, SLOT(sceneResized(QSize)));
+ QObject::connect(canvas, SIGNAL(initialSize(QSize)), this, SLOT(adjustSizeSlot()));
QObject::connect(canvas, SIGNAL(errors(QList<QmlError>)), this, SLOT(executeErrors()));
if (!(flags & Qt::FramelessWindowHint))
@@ -335,6 +336,11 @@ QmlViewer::QmlViewer(QWidget *parent, Qt::WindowFlags flags)
recordTimer.setRepeating(true);
}
+void QmlViewer::adjustSizeSlot()
+{
+ adjustSize();
+}
+
QMenuBar *QmlViewer::menuBar() const
{
if (!mb)
@@ -680,7 +686,7 @@ void QmlViewer::openQml(const QUrl& url)
canvas->updateGeometry();
if (mb)
mb->updateGeometry();
- resize(sizeHint());
+ adjustSize();
} else {
if (scaleSkin)
canvas->resize(canvas->sizeHint());