summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2018-06-30 13:53:03 +0200
committerDaniel Vrátil <dvratil@kde.org>2018-06-30 13:23:03 +0000
commit35e005bc4fd790d41a5b5248e85bbdac33fbf043 (patch)
tree21c97ff7cff9bbb05aab36ef181e5528006dff7f /src
parent0ac09c40f28987169786b3063af423e9fe93c6b8 (diff)
Fix metatype trait for types that are both QObject and Q_GADGET
Fixes ambiguous template instantiation for types that derive from both a QObject and Q_GADGET. For such types we treat them only as QObjects as they extend the functionality of the gadget. Task-number: QTBUG-68803 Change-Id: Ic42766034e14e5df43c4e6f7811e2c0be1dc7e74 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qmetatype.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index a0969ee908..cf68752f85 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -1413,8 +1413,8 @@ namespace QtPrivate
static char checkType(void (X::*)());
static void *checkType(void (T::*)());
enum {
- IsRealGadget = sizeof(checkType(&T::qt_check_for_QGADGET_macro)) == sizeof(void *),
- IsGadgetOrDerivedFrom = true
+ IsRealGadget = !IsPointerToTypeDerivedFromQObject<T*>::Value && sizeof(checkType(&T::qt_check_for_QGADGET_macro)) == sizeof(void *),
+ IsGadgetOrDerivedFrom = !IsPointerToTypeDerivedFromQObject<T*>::Value
};
};