From 6a1db458c277c00059dc763c17398798c30240be Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 17 Oct 2011 16:02:01 +0200 Subject: Declarative: Give qmlscene top level window flags. Add menu and close buttons on Windows as well. Change-Id: Ie458f8f21b14583c1a02d48819ec797e6db7390e Reviewed-by: Aaron Kennedy --- tools/qmlscene/main.cpp | 52 ++++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 24 deletions(-) (limited to 'tools') diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index cd40ea5f8c..c5f9274571 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -424,31 +424,34 @@ int main(int argc, char ** argv) QStringList imports; for (int i = 1; i < argc; ++i) { - if (*argv[i] != '-' && QFileInfo(argv[i]).exists()) + if (*argv[i] != '-' && QFileInfo(QFile::decodeName(argv[i])).exists()) { options.file = QUrl::fromLocalFile(argv[i]); - else if (QString::fromLatin1(argv[i]).toLower() == QLatin1String("--original-qml")) - options.originalQml = true; - else if (QString::fromLatin1(argv[i]).toLower() == QLatin1String("--original-qml-raster")) - options.originalQmlRaster = true; - else if (QString::fromLatin1(argv[i]).toLower() == QLatin1String("--maximized")) - options.maximized = true; - else if (QString::fromLatin1(argv[i]).toLower() == QLatin1String("--fullscreen")) - options.fullscreen = true; - else if (QString::fromLatin1(argv[i]).toLower() == QLatin1String("--sg-on-gv")) - options.scenegraphOnGraphicsview = true; - else if (QString::fromLatin1(argv[i]).toLower() == QLatin1String("--clip")) - options.clip = true; - else if (QString::fromLatin1(argv[i]).toLower() == QLatin1String("--no-version-detection")) - options.versionDetection = false; - else if (QString::fromLatin1(argv[i]).toLower() == QLatin1String("-i") && i + 1 < argc) - imports.append(QString::fromLatin1(argv[++i])); - else if (QString::fromLatin1(argv[i]).toLower() == QLatin1String("--no-vsync-animations")) - options.vsync = false; - else if (QString::fromLatin1(argv[i]).toLower() == QLatin1String("--help") - || QString::fromLatin1(argv[i]).toLower() == QLatin1String("-help") - || QString::fromLatin1(argv[i]).toLower() == QLatin1String("--h") - || QString::fromLatin1(argv[i]).toLower() == QLatin1String("-h")) - usage(); + } else { + const QString lowerArgument = QString::fromLatin1(argv[i]).toLower(); + if (lowerArgument == QLatin1String("--original-qml")) + options.originalQml = true; + else if (lowerArgument == QLatin1String("--original-qml-raster")) + options.originalQmlRaster = true; + else if (lowerArgument == QLatin1String("--maximized")) + options.maximized = true; + else if (lowerArgument == QLatin1String("--fullscreen")) + options.fullscreen = true; + else if (lowerArgument == QLatin1String("--sg-on-gv")) + options.scenegraphOnGraphicsview = true; + else if (lowerArgument == QLatin1String("--clip")) + options.clip = true; + else if (lowerArgument == QLatin1String("--no-version-detection")) + options.versionDetection = false; + else if (lowerArgument == QLatin1String("-i") && i + 1 < argc) + imports.append(QString::fromLatin1(argv[++i])); + else if (lowerArgument == QLatin1String("--no-vsync-animations")) + options.vsync = false; + else if (lowerArgument == QLatin1String("--help") + || lowerArgument == QLatin1String("-help") + || lowerArgument == QLatin1String("--h") + || lowerArgument == QLatin1String("-h")) + usage(); + } } QApplication::setGraphicsSystem("raster"); @@ -502,6 +505,7 @@ int main(int argc, char ** argv) QObject::connect(engine, SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit())); + window->setWindowFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); if (options.fullscreen) window->showFullScreen(); else if (options.maximized) -- cgit v1.2.3