summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2016-06-16 18:09:52 +0300
committerSean Harmer <sean.harmer@kdab.com>2016-06-20 14:33:58 +0000
commit7fab1fa65675dfd62b1ddf6fed3226e465b37b67 (patch)
tree3361cb53b0295fa342679e9254a45ef235232094
parent4862fea330cffdc4f9fb2972e76287487444e8b4 (diff)
Replace “#define private public” with a proper friend class declaration
Change-Id: I98a31d165367e725c902df368c9c2824439a47d6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/core/resources/qhandle_p.h3
-rw-r--r--tests/auto/core/handle/tst_handle.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/core/resources/qhandle_p.h b/src/core/resources/qhandle_p.h
index 6952c54e3..2916d7e42 100644
--- a/src/core/resources/qhandle_p.h
+++ b/src/core/resources/qhandle_p.h
@@ -51,6 +51,8 @@
#include <Qt3DCore/qt3dcore_global.h>
#include <QtCore/QDebug>
+class tst_Handle; // needed for friend class declaration below
+
QT_BEGIN_NAMESPACE
namespace Qt3DCore {
@@ -100,6 +102,7 @@ private:
friend class QHandleManager<T, INDEXBITS>;
+ friend class ::tst_Handle;
struct Data {
quint32 m_index : IndexBits;
diff --git a/tests/auto/core/handle/tst_handle.cpp b/tests/auto/core/handle/tst_handle.cpp
index 9ed3a17d6..0fe760b94 100644
--- a/tests/auto/core/handle/tst_handle.cpp
+++ b/tests/auto/core/handle/tst_handle.cpp
@@ -35,10 +35,6 @@
****************************************************************************/
#include <QtTest/QtTest>
-
-// Not really clean but as the QHandle(idx, counter) is private
-// This allows to use this constructor in the tests
-#define private public
#include <Qt3DCore/private/qhandle_p.h>
#if Q_BYTE_ORDER == Q_BIG_ENDIAN