summaryrefslogtreecommitdiffstats
path: root/src/openglwidgets
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-11-09 11:15:01 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-11-09 13:49:56 +0100
commit8379de41f6c4033d95f39c86dceaa6ae8796f0b8 (patch)
treee91ebef7a620a50cc3d855ce6602c857421a132e /src/openglwidgets
parent696114494c895448289bcf5f7bbe51e290f02424 (diff)
Member-initialize QOpenGLWidgetPrivate
Fix warning about requestedFormat not being initialized in sequence. Change-Id: I7b948cb356b65ea2953424a700eb1a70cd1802f9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/openglwidgets')
-rw-r--r--src/openglwidgets/qopenglwidget.cpp53
1 files changed, 18 insertions, 35 deletions
diff --git a/src/openglwidgets/qopenglwidget.cpp b/src/openglwidgets/qopenglwidget.cpp
index c47df876dd..8dbb9180f4 100644
--- a/src/openglwidgets/qopenglwidget.cpp
+++ b/src/openglwidgets/qopenglwidget.cpp
@@ -480,7 +480,7 @@ QT_BEGIN_NAMESPACE
class QOpenGLWidgetPaintDevicePrivate : public QOpenGLPaintDevicePrivate
{
public:
- QOpenGLWidgetPaintDevicePrivate(QOpenGLWidget *widget)
+ explicit QOpenGLWidgetPaintDevicePrivate(QOpenGLWidget *widget)
: QOpenGLPaintDevicePrivate(QSize()),
w(widget) { }
@@ -493,7 +493,7 @@ public:
class QOpenGLWidgetPaintDevice : public QOpenGLPaintDevice
{
public:
- QOpenGLWidgetPaintDevice(QOpenGLWidget *widget)
+ explicit QOpenGLWidgetPaintDevice(QOpenGLWidget *widget)
: QOpenGLPaintDevice(*new QOpenGLWidgetPaintDevicePrivate(widget)) { }
void ensureActiveTarget() override;
};
@@ -502,24 +502,7 @@ class QOpenGLWidgetPrivate : public QWidgetPrivate
{
Q_DECLARE_PUBLIC(QOpenGLWidget)
public:
- QOpenGLWidgetPrivate()
- : context(nullptr),
- fbo(nullptr),
- resolvedFbo(nullptr),
- surface(nullptr),
- initialized(false),
- fakeHidden(false),
- inBackingStorePaint(false),
- hasBeenComposed(false),
- flushPending(false),
- paintDevice(nullptr),
- updateBehavior(QOpenGLWidget::NoPartialUpdate),
- requestedSamples(0),
- inPaintGL(false),
- textureFormat(0)
- {
- requestedFormat = QSurfaceFormat::defaultFormat();
- }
+ QOpenGLWidgetPrivate() = default;
void reset();
void recreateFbo();
@@ -542,21 +525,21 @@ public:
void resizeViewportFramebuffer() override;
void resolveSamples() override;
- QOpenGLContext *context;
- QOpenGLFramebufferObject *fbo;
- QOpenGLFramebufferObject *resolvedFbo;
- QOffscreenSurface *surface;
- bool initialized;
- bool fakeHidden;
- bool inBackingStorePaint;
- bool hasBeenComposed;
- bool flushPending;
- QOpenGLPaintDevice *paintDevice;
- QSurfaceFormat requestedFormat;
- QOpenGLWidget::UpdateBehavior updateBehavior;
- int requestedSamples;
- bool inPaintGL;
- GLenum textureFormat;
+ QOpenGLContext *context = nullptr;
+ QOpenGLFramebufferObject *fbo = nullptr;
+ QOpenGLFramebufferObject *resolvedFbo = nullptr;
+ QOffscreenSurface *surface = nullptr;
+ QOpenGLPaintDevice *paintDevice = nullptr;
+ int requestedSamples = 0;
+ GLenum textureFormat = 0;
+ QSurfaceFormat requestedFormat = QSurfaceFormat::defaultFormat();
+ QOpenGLWidget::UpdateBehavior updateBehavior = QOpenGLWidget::NoPartialUpdate;
+ bool initialized = false;
+ bool fakeHidden = false;
+ bool inBackingStorePaint = false;
+ bool hasBeenComposed = false;
+ bool flushPending = false;
+ bool inPaintGL = false;
};
void QOpenGLWidgetPaintDevicePrivate::beginPaint()