summaryrefslogtreecommitdiffstats
path: root/examples/opengl/threadedqopenglwidget
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-06 13:26:31 +0200
committerLiang Qi <liang.qi@qt.io>2017-09-06 13:26:31 +0200
commit19dd2ca93b8b95a5e2792b29ed62ea23800fb53e (patch)
tree17685d2a9628ec5936155e09da3edd74c9244b0e /examples/opengl/threadedqopenglwidget
parent942922652481347659a0dae78758c334778a58d2 (diff)
parentd332a2d3ccb485c9decd6c47fa5a5fc02b59d27e (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: examples/opengl/qopenglwidget/main.cpp src/3rdparty/pcre2/src/pcre2_printint.c src/plugins/platforms/cocoa/qnsview.mm src/widgets/widgets/qcombobox.cpp Change-Id: I37ced9da1e8056f95851568bcc52cd5dc34f56af
Diffstat (limited to 'examples/opengl/threadedqopenglwidget')
-rw-r--r--examples/opengl/threadedqopenglwidget/main.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/examples/opengl/threadedqopenglwidget/main.cpp b/examples/opengl/threadedqopenglwidget/main.cpp
index c22cee9228..b9e491040f 100644
--- a/examples/opengl/threadedqopenglwidget/main.cpp
+++ b/examples/opengl/threadedqopenglwidget/main.cpp
@@ -53,6 +53,8 @@
#include <QDesktopWidget>
#include <QSurfaceFormat>
#include <QOpenGLContext>
+#include <QCommandLineParser>
+#include <QCommandLineOption>
#include "mainwindow.h"
#include "glwidget.h"
@@ -67,6 +69,17 @@ int main( int argc, char ** argv )
{
QApplication a( argc, argv );
+ QCoreApplication::setApplicationName("Qt Threaded QOpenGLWidget Example");
+ QCoreApplication::setOrganizationName("QtProject");
+ QCoreApplication::setApplicationVersion(QT_VERSION_STR);
+ QCommandLineParser parser;
+ parser.setApplicationDescription(QCoreApplication::applicationName());
+ parser.addHelpOption();
+ parser.addVersionOption();
+ QCommandLineOption singleOption("single", "Single thread");
+ parser.addOption(singleOption);
+ parser.process(a);
+
QSurfaceFormat format;
format.setDepthBufferSize(16);
QSurfaceFormat::setDefaultFormat(format);
@@ -93,7 +106,7 @@ int main( int argc, char ** argv )
QScopedPointer<MainWindow> mw1;
QScopedPointer<MainWindow> mw2;
- if (!QApplication::arguments().contains(QStringLiteral("--single"))) {
+ if (!parser.isSet(singleOption)) {
if (supportsThreading) {
pos += QPoint(100, 100);
mw1.reset(new MainWindow);