From 6dac557fd3b9c913f1bc8b863bb676fc46df4b05 Mon Sep 17 00:00:00 2001
From: Lars Knoll <lars.knoll@digia.com>
Date: Wed, 19 Nov 2014 12:05:27 +0100
Subject: [PATCH] Correct the signature and access rights for the protected
 constructor

Change-Id: Ic43398a82777f3b1a95a36f60ebc4338d60c29ec
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
---
 src/gui/opengl/qopenglpaintdevice.cpp | 4 ++--
 src/gui/opengl/qopenglpaintdevice.h   | 2 +-
 src/widgets/kernel/qopenglwidget.cpp  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp
index e908fd8e915..a08d26f7081 100644
--- a/src/gui/opengl/qopenglpaintdevice.cpp
+++ b/src/gui/opengl/qopenglpaintdevice.cpp
@@ -138,8 +138,8 @@ QOpenGLPaintDevice::QOpenGLPaintDevice(int width, int height)
 /*!
     \internal
  */
-QOpenGLPaintDevice::QOpenGLPaintDevice(QOpenGLPaintDevicePrivate *dd)
-    : d_ptr(dd)
+QOpenGLPaintDevice::QOpenGLPaintDevice(QOpenGLPaintDevicePrivate &dd)
+    : d_ptr(&dd)
 {
 }
 
diff --git a/src/gui/opengl/qopenglpaintdevice.h b/src/gui/opengl/qopenglpaintdevice.h
index dda3bfe43f6..10cee842ab0 100644
--- a/src/gui/opengl/qopenglpaintdevice.h
+++ b/src/gui/opengl/qopenglpaintdevice.h
@@ -53,7 +53,6 @@ public:
     QOpenGLPaintDevice();
     explicit QOpenGLPaintDevice(const QSize &size);
     QOpenGLPaintDevice(int width, int height);
-    QOpenGLPaintDevice(QOpenGLPaintDevicePrivate *dd);
     virtual ~QOpenGLPaintDevice();
 
     int devType() const { return QInternal::OpenGL; }
@@ -76,6 +75,7 @@ public:
     virtual void ensureActiveTarget();
 
 protected:
+    QOpenGLPaintDevice(QOpenGLPaintDevicePrivate &dd);
     int metric(QPaintDevice::PaintDeviceMetric metric) const;
 
     Q_DISABLE_COPY(QOpenGLPaintDevice)
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index 8a4e0c8ffdd..23bb1f7050c 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -471,7 +471,7 @@ class QOpenGLWidgetPaintDevice : public QOpenGLPaintDevice
 {
 public:
     QOpenGLWidgetPaintDevice(QOpenGLWidget *widget)
-        : QOpenGLPaintDevice(new QOpenGLWidgetPaintDevicePrivate(widget)) { }
+        : QOpenGLPaintDevice(*new QOpenGLWidgetPaintDevicePrivate(widget)) { }
     void ensureActiveTarget() Q_DECL_OVERRIDE;
 };
 
-- 
GitLab