diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-03-30 02:20:58 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-03-30 02:20:58 (GMT) |
commit | 8368e041e35ab2a79c79f651a56e6ee53a46549f (patch) | |
tree | 766d0a3eec7428307412ae52bf465485d2bb17aa /tools/qml | |
parent | 56aa9370dbafa8ee431dd2ffabef309aae01ec2f (diff) | |
download | Qt-8368e041e35ab2a79c79f651a56e6ee53a46549f.zip Qt-8368e041e35ab2a79c79f651a56e6ee53a46549f.tar.gz Qt-8368e041e35ab2a79c79f651a56e6ee53a46549f.tar.bz2 |
Fix viewer resizing on reload and File->open
Task-number: QTBUG-9325
Diffstat (limited to 'tools/qml')
-rw-r--r-- | tools/qml/qmlruntime.cpp | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index d4ceb0b..44cab97 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -995,8 +995,22 @@ void QDeclarativeViewer::statusChanged() if (canvas->status() == QDeclarativeView::Error && tester) tester->executefailure(); - if (canvas->status() == QDeclarativeView::Ready) - resize(sizeHint()); + if (canvas->status() == QDeclarativeView::Ready) { + if (!skin) { + canvas->updateGeometry(); + if (mb) + mb->updateGeometry(); + if (!isFullScreen() && !isMaximized()) + resize(sizeHint()); + } else { + if (scaleSkin) + canvas->resize(canvas->sizeHint()); + else { + canvas->setFixedSize(skin->standardScreenSize()); + canvas->resize(skin->standardScreenSize()); + } + } + } } void QDeclarativeViewer::launch(const QString& file_or_url) @@ -1077,21 +1091,6 @@ void QDeclarativeViewer::openQml(const QString& file_or_url) qWarning() << "Wall startup time:" << t.elapsed(); - if (!skin) { - canvas->updateGeometry(); - if (mb) - mb->updateGeometry(); - if (!isFullScreen() && !isMaximized()) - resize(sizeHint()); - } else { - if (scaleSkin) - canvas->resize(canvas->sizeHint()); - else { - canvas->setFixedSize(skin->standardScreenSize()); - canvas->resize(skin->standardScreenSize()); - } - } - #ifdef QTOPIA show(); #endif |