aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/quickwidgets/qquickviewcomparison/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/quickwidgets/qquickviewcomparison/main.cpp')
-rw-r--r--examples/quick/quickwidgets/qquickviewcomparison/main.cpp36
1 files changed, 31 insertions, 5 deletions
diff --git a/examples/quick/quickwidgets/qquickviewcomparison/main.cpp b/examples/quick/quickwidgets/qquickviewcomparison/main.cpp
index 7e45e42527..73db97eddb 100644
--- a/examples/quick/quickwidgets/qquickviewcomparison/main.cpp
+++ b/examples/quick/quickwidgets/qquickviewcomparison/main.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
@@ -39,6 +49,8 @@
****************************************************************************/
#include <QApplication>
+#include <QCommandLineParser>
+#include <QCommandLineOption>
#include "mainwindow.h"
@@ -48,8 +60,22 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
- bool transparency = QCoreApplication::arguments().contains(QStringLiteral("--transparent"));
- MainWindow widgetWindow(transparency);
+ QCoreApplication::setApplicationName("Qt QQuickView/QQuickWidget Comparison Example");
+ QCoreApplication::setOrganizationName("QtProject");
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QCommandLineParser parser;
+ parser.setApplicationDescription(QCoreApplication::applicationName());
+ parser.addHelpOption();
+ parser.addVersionOption();
+ QCommandLineOption noRenderAlphaOption("no-render-alpha", "Do not render Alpha");
+ parser.addOption(noRenderAlphaOption);
+ QCommandLineOption transparentOption("transparent", "Transparent window");
+ parser.addOption(transparentOption);
+
+ parser.process(app);
+
+ const bool transparency = parser.isSet(transparentOption);
+ MainWindow widgetWindow(transparency, parser.isSet(noRenderAlphaOption));
if (transparency) {
widgetWindow.setAttribute(Qt::WA_TranslucentBackground);
widgetWindow.setAttribute(Qt::WA_NoSystemBackground, false);