diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-10-01 06:38:39 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-10-01 06:38:39 (GMT) |
commit | 832c7895a0b9fcd798f4497c87742731e872247d (patch) | |
tree | 3bcd3a20b928816258cdb98bce965e14e26d9938 /tools | |
parent | 906f5f6a825c500e4cc1d2d9c7be08444d394774 (diff) | |
download | Qt-832c7895a0b9fcd798f4497c87742731e872247d.zip Qt-832c7895a0b9fcd798f4497c87742731e872247d.tar.gz Qt-832c7895a0b9fcd798f4497c87742731e872247d.tar.bz2 |
Auto-resize window when a new file is opened from the Open dialog. Also
set the Open dialog's initial directory to directory of the current
file.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 49b91af..b2884dd 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -586,7 +586,7 @@ void QmlViewer::reload() void QmlViewer::open() { - QString fileName = QFileDialog::getOpenFileName(this, tr("Open QML file"), "", tr("QML Files (*.qml)")); + QString fileName = QFileDialog::getOpenFileName(this, tr("Open QML file"), currentFileName, tr("QML Files (*.qml)")); if (!fileName.isEmpty()) { openQml(fileName); QTimer::singleShot(0, this, SLOT(reload())); @@ -649,6 +649,7 @@ void QmlViewer::openQml(const QString& fileName) qWarning() << "Wall startup time:" << t.elapsed(); if (!skin) { + canvas->updateGeometry(); canvas->resize(canvas->sizeHint()); resize(sizeHint()); } else { |