diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-05-13 06:17:19 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-05-13 06:17:19 (GMT) |
commit | 4788467341f4363c383589402eccd3e1987c1df3 (patch) | |
tree | 0c56990e6a4b0b6c21dc294a1b3fd8d64f183299 /tools | |
parent | 1f8376d3abfa35ab73ae9f0a52a5d597f54040df (diff) | |
download | Qt-4788467341f4363c383589402eccd3e1987c1df3.zip Qt-4788467341f4363c383589402eccd3e1987c1df3.tar.gz Qt-4788467341f4363c383589402eccd3e1987c1df3.tar.bz2 |
Work with no initial file (open dialog).
Resize correctly on open new file.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlviewer/main.cpp | 8 | ||||
-rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/tools/qmlviewer/main.cpp b/tools/qmlviewer/main.cpp index f5a80b0..f27606e 100644 --- a/tools/qmlviewer/main.cpp +++ b/tools/qmlviewer/main.cpp @@ -130,12 +130,8 @@ int main(int argc, char ** argv) } } - if (fileName.isEmpty()) - usage(); - QmlViewer viewer(testMode, testDir, 0, frameless ? Qt::FramelessWindowHint : Qt::Widget); viewer.setCacheEnabled(cache); - viewer.openQml(fileName); viewer.setRecordFile(recordfile); if (period>0) viewer.setRecordPeriod(period); @@ -147,6 +143,10 @@ int main(int argc, char ** argv) viewer.setDeviceKeys(true); viewer.setRecordDither(dither); viewer.setRecordArgs(recordargs); + if (!fileName.isEmpty()) + viewer.openQml(fileName); + else + viewer.open(); viewer.show(); return app.exec(); diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 08b1497..2eddb6a 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -209,6 +209,9 @@ void QmlViewer::openQml(const QString& fileName) t.start(); canvas->execute(); qWarning() << "Wall startup time:" << t.elapsed(); + + resize(sizeHint()); + #ifdef QTOPIA show(); #endif |