diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-08-29 16:21:17 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-09-05 10:54:15 +0000 |
commit | b3717fc7f01ae078faf066538ddc80fca016ef0c (patch) | |
tree | 2324db6abe1995fbe9dd35fc6bd9ea83b464c787 /examples/opengl/hellogl2/glwidget.cpp | |
parent | d64940891dffcb951f4b76426490cbc94fb4aba7 (diff) |
OpenGL examples: Introduce QCommandLineParser
Task-number: QTBUG-60626
Change-Id: I6d102327c89206fcdce10f3ac04e112270b11ad2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'examples/opengl/hellogl2/glwidget.cpp')
-rw-r--r-- | examples/opengl/hellogl2/glwidget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/opengl/hellogl2/glwidget.cpp b/examples/opengl/hellogl2/glwidget.cpp index fc961da4c4..f9518ffac5 100644 --- a/examples/opengl/hellogl2/glwidget.cpp +++ b/examples/opengl/hellogl2/glwidget.cpp @@ -54,6 +54,8 @@ #include <QCoreApplication> #include <math.h> +bool GLWidget::m_transparent = false; + GLWidget::GLWidget(QWidget *parent) : QOpenGLWidget(parent), m_xRot(0), @@ -61,10 +63,9 @@ GLWidget::GLWidget(QWidget *parent) m_zRot(0), m_program(0) { - m_core = QCoreApplication::arguments().contains(QStringLiteral("--coreprofile")); + m_core = QSurfaceFormat::defaultFormat().profile() == QSurfaceFormat::CoreProfile; // --transparent causes the clear color to be transparent. Therefore, on systems that // support it, the widget will become transparent apart from the logo. - m_transparent = QCoreApplication::arguments().contains(QStringLiteral("--transparent")); if (m_transparent) { QSurfaceFormat fmt = format(); fmt.setAlphaBufferSize(8); |