From c7f0e3ebc2253e6b549ce2271cfdb002c110ee24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= Date: Tue, 27 Dec 2016 01:31:10 +0100 Subject: [PATCH] Use qGetPtrHelper in Q_DECLARE_PRIVATE_D macro This allows the Dptr parameter of the Q_DECLARE_PRIVATE_D macro to be a smart pointer, not just a raw pointer. Change-Id: Iaf27352e327e9aedea149461d47f2f11460a42dc Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 7a0804d436..127e1e7e13 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -985,8 +985,8 @@ template static inline typename Wrapper::pointer qGetPtrHelpe friend class Class##Private; #define Q_DECLARE_PRIVATE_D(Dptr, Class) \ - inline Class##Private* d_func() { return reinterpret_cast(Dptr); } \ - inline const Class##Private* d_func() const { return reinterpret_cast(Dptr); } \ + inline Class##Private* d_func() { return reinterpret_cast(qGetPtrHelper(Dptr)); } \ + inline const Class##Private* d_func() const { return reinterpret_cast(qGetPtrHelper(Dptr)); } \ friend class Class##Private; #define Q_DECLARE_PUBLIC(Class) \