diff options
author | Harald Fernengel <harald.fernengel@nokia.com> | 2010-06-16 13:16:16 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2010-06-16 13:16:16 (GMT) |
commit | 6d4e14ef0437ce8f73bddbcb267cf5ef708fbdec (patch) | |
tree | 22697bc553d59ab3e660823633143f01dc3205e7 | |
parent | 39d357505c7de6430f73cd5a491c2a7ddccd55ea (diff) | |
download | Qt-6d4e14ef0437ce8f73bddbcb267cf5ef708fbdec.zip Qt-6d4e14ef0437ce8f73bddbcb267cf5ef708fbdec.tar.gz Qt-6d4e14ef0437ce8f73bddbcb267cf5ef708fbdec.tar.bz2 |
Micro cleanup
Use Qt::WA_DeleteOnClose to clean up the top-level window
Reviewed-by: Alan Alpert
-rw-r--r-- | tools/qml/main.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 0cce1cc..a75023b 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -347,8 +347,9 @@ int main(int argc, char ** argv) wflags |= Qt::WindowStaysOnTopHint; QDeclarativeViewer *viewer = new QDeclarativeViewer(0, wflags); + viewer->setAttribute(Qt::WA_DeleteOnClose, true); if (!scriptopts.isEmpty()) { - QStringList options = + QStringList options = scriptopts.split(QLatin1Char(','), QString::SkipEmptyParts); QDeclarativeViewer::ScriptOptions scriptOptions = 0; @@ -451,7 +452,5 @@ int main(int argc, char ** argv) viewer->setUseGL(useGL); viewer->raise(); - int rv = app.exec(); - delete viewer; - exit(rv); + return app.exec(); } |