path: root/src
diff options
authorOlivier Goffart <>2013-02-05 14:35:10 +0100
committerThe Qt Project <>2013-02-21 14:54:00 +0100
commit03b25125986f083a260b421abeed1f1d088d27b3 (patch)
tree307f0e248f006cbc9dc7f85abf900ee886f4a769 /src
parent8fd1330029eafc3f9496febd1ac2597e786ba324 (diff)
Fix QMetaType of const references
This fixes QMetaType detection of const reference arguments in signals while connecting using the new syntax and Qt::QueuedConnection const references should have the same QMetaType as non references. That means we need to remove the const reference while getting the QMetaType. Change-Id: I9b2688da7fb9ae985aec0d8fa62a1165357ffe71 Reviewed-by: Thiago Macieira <> Reviewed-by: Stephen Kelly <> Reviewed-by: Jędrzej Nowacki <>
Diffstat (limited to 'src')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index e4f1052673..16ea1042a2 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -532,6 +532,9 @@ struct QMetaTypeId2
static inline Q_DECL_CONSTEXPR int qt_metatype_id() { return QMetaTypeId<T>::qt_metatype_id(); }
+template <typename T>
+struct QMetaTypeId2<const T&> : QMetaTypeId2<T> {};
namespace QtPrivate {
template <typename T, bool Defined = QMetaTypeId2<T>::Defined>
struct QMetaTypeIdHelper {