diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-09-13 20:43:09 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-09-30 22:16:27 +0200 |
commit | b0042601ed8056c9ed6056c26f71dfa9fbc951ce (patch) | |
tree | 9288bbda958a9e0755d3179de0fe5325d9bd7898 /examples/opengl/contextinfo | |
parent | fbda189e081e6c7abf82334c0ac71b16ec2c37dd (diff) |
Cleanup QtOpenGL examples
Cleanup the OpenGL examples
- use nullptr (clang-tidy)
- use member-initialization
- avoid redundant checks for != nullptr when deleting a pointer
Change-Id: I3e4702690ed79e71c3e952d51ceef83b907b45b7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'examples/opengl/contextinfo')
-rw-r--r-- | examples/opengl/contextinfo/renderwindow.cpp | 4 | ||||
-rw-r--r-- | examples/opengl/contextinfo/widget.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/opengl/contextinfo/renderwindow.cpp b/examples/opengl/contextinfo/renderwindow.cpp index 21b7434be6..ea9a7a24cb 100644 --- a/examples/opengl/contextinfo/renderwindow.cpp +++ b/examples/opengl/contextinfo/renderwindow.cpp @@ -56,7 +56,7 @@ #include <QOpenGLFunctions> RenderWindow::RenderWindow(const QSurfaceFormat &format) - : m_context(0), + : m_context(nullptr), m_initialized(false), m_forceGLSL110(false), m_angle(0.0f) @@ -67,7 +67,7 @@ RenderWindow::RenderWindow(const QSurfaceFormat &format) m_context->setFormat(requestedFormat()); if (!m_context->create()) { delete m_context; - m_context = 0; + m_context = nullptr; } } diff --git a/examples/opengl/contextinfo/widget.h b/examples/opengl/contextinfo/widget.h index 72abe0e647..85d181a229 100644 --- a/examples/opengl/contextinfo/widget.h +++ b/examples/opengl/contextinfo/widget.h @@ -64,7 +64,7 @@ class Widget : public QWidget Q_OBJECT public: - explicit Widget(QWidget *parent = 0); + explicit Widget(QWidget *parent = nullptr); private slots: void start(); |