diff options
Diffstat (limited to 'examples/opengl/textures')
-rw-r--r-- | examples/opengl/textures/glwidget.cpp | 11 | ||||
-rw-r--r-- | examples/opengl/textures/glwidget.h | 14 |
2 files changed, 7 insertions, 18 deletions
diff --git a/examples/opengl/textures/glwidget.cpp b/examples/opengl/textures/glwidget.cpp index 1644233614..307190f308 100644 --- a/examples/opengl/textures/glwidget.cpp +++ b/examples/opengl/textures/glwidget.cpp @@ -53,17 +53,6 @@ #include <QOpenGLTexture> #include <QMouseEvent> -GLWidget::GLWidget(QWidget *parent) - : QOpenGLWidget(parent), - clearColor(Qt::black), - xRot(0), - yRot(0), - zRot(0), - program(0) -{ - memset(textures, 0, sizeof(textures)); -} - GLWidget::~GLWidget() { makeCurrent(); diff --git a/examples/opengl/textures/glwidget.h b/examples/opengl/textures/glwidget.h index 0db2695c6a..585d44dbfe 100644 --- a/examples/opengl/textures/glwidget.h +++ b/examples/opengl/textures/glwidget.h @@ -63,7 +63,7 @@ class GLWidget : public QOpenGLWidget, protected QOpenGLFunctions Q_OBJECT public: - explicit GLWidget(QWidget *parent = 0); + using QOpenGLWidget::QOpenGLWidget; ~GLWidget(); QSize minimumSizeHint() const override; @@ -85,13 +85,13 @@ protected: private: void makeObject(); - QColor clearColor; + QColor clearColor = Qt::black; QPoint lastPos; - int xRot; - int yRot; - int zRot; - QOpenGLTexture *textures[6]; - QOpenGLShaderProgram *program; + int xRot = 0; + int yRot = 0; + int zRot = 0; + QOpenGLTexture *textures[6] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}; + QOpenGLShaderProgram *program = nullptr; QOpenGLBuffer vbo; }; |