summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobjectdefs.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-12-16 12:51:38 -0800
committerThiago Macieira <thiago.macieira@intel.com>2016-12-28 12:43:53 +0000
commitd908ba2765cc7aef05832c8c442df6c1bf921820 (patch)
treea9b5bbb6c21adeb1fcb5e209c568224d90a9f605 /src/corelib/kernel/qobjectdefs.h
parentdc6b73390b262b9554599cbf40539763b1280261 (diff)
Remove HarryF's "compiler error feature" that isn't used anymore
The "qYouForgotTheQ_OBJECT_Macro" function hasn't been used in qobject_cast since commit 7d7e8ae3fa79b06c916de1a7a10eed63611c5d25 (Qt 5.2), when Olivier made the error use Q_STATIC_ASSERT instead. Change-Id: I15b62e0f9cec482fbb40fffd1490d7c050084369 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/kernel/qobjectdefs.h')
-rw-r--r--src/corelib/kernel/qobjectdefs.h31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 5cdbef443b..f577c6d4b8 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -147,34 +147,8 @@ class QString;
# define QT_TR_FUNCTIONS
#endif
-#if defined(QT_NO_QOBJECT_CHECK)
-/* qmake ignore Q_OBJECT */
-#define Q_OBJECT_CHECK
-#else
-
-/* This is a compile time check that ensures that any class cast with qobject_cast
- actually contains a Q_OBJECT macro. Note: qobject_cast will fail if a QObject
- subclass doesn't contain Q_OBJECT.
-
- In qt_check_for_QOBJECT_macro, we call a dummy templated function with two
- parameters, the first being "this" and the other the target of the qobject
- cast. If the types are not identical, we know that a Q_OBJECT macro is missing.
-
- If you get a compiler error here, make sure that the class you are casting
- to contains a Q_OBJECT macro.
-*/
-
-/* qmake ignore Q_OBJECT */
-#define Q_OBJECT_CHECK \
- template <typename ThisObject> inline void qt_check_for_QOBJECT_macro(const ThisObject &_q_argument) const \
- { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; }
-
-template <typename T>
-inline int qYouForgotTheQ_OBJECT_Macro(T, T) { return 0; }
-
-template <typename T1, typename T2>
-inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
-#endif // QT_NO_QOBJECT_CHECK
+// ### Qt6: remove
+#define Q_OBJECT_CHECK /* empty, unused since Qt 5.2 */
#if defined(Q_CC_INTEL)
// Cannot redefine the visibility of a method in an exported class
@@ -200,7 +174,6 @@ inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
/* qmake ignore Q_OBJECT */
#define Q_OBJECT \
public: \
- Q_OBJECT_CHECK \
QT_WARNING_PUSH \
Q_OBJECT_NO_OVERRIDE_WARNING \
static const QMetaObject staticMetaObject; \