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/gui/openglwindow/openglwindow.h | |
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/gui/openglwindow/openglwindow.h')
-rw-r--r-- | examples/gui/openglwindow/openglwindow.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/gui/openglwindow/openglwindow.h b/examples/gui/openglwindow/openglwindow.h index 6e6c1d7449..8db943ddde 100644 --- a/examples/gui/openglwindow/openglwindow.h +++ b/examples/gui/openglwindow/openglwindow.h @@ -48,8 +48,8 @@ ** ****************************************************************************/ -#include <QtGui/QWindow> -#include <QtGui/QOpenGLFunctions> +#include <QWindow> +#include <QOpenGLFunctions> QT_BEGIN_NAMESPACE class QPainter; @@ -62,7 +62,7 @@ class OpenGLWindow : public QWindow, protected QOpenGLFunctions { Q_OBJECT public: - explicit OpenGLWindow(QWindow *parent = 0); + explicit OpenGLWindow(QWindow *parent = nullptr); ~OpenGLWindow(); virtual void render(QPainter *painter); @@ -82,10 +82,10 @@ protected: void exposeEvent(QExposeEvent *event) override; private: - bool m_animating; + bool m_animating = false; - QOpenGLContext *m_context; - QOpenGLPaintDevice *m_device; + QOpenGLContext *m_context = nullptr; + QOpenGLPaintDevice *m_device = nullptr; }; //! [1] |