QMetaType: disallow automatic registration of reference type

The automatic registration code that would be added will break
with a reference type.

QObject's template code calls QMetaTypeId2 on the arguments of the
signal. Including on references.

Reference type cannot be register as metatype. They are not supported
in QVariant, or in QueuedConnection.

Change-Id: I83f2e50f9f886909dc24f3809c990e5763012cc2
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
bb10
Olivier Goffart 2014-08-10 23:16:51 +02:00
parent b2a7d865b2
commit 72c99dd446
1 changed files with 3 additions and 0 deletions

View File

@ -1518,6 +1518,9 @@ struct QMetaTypeId2
template <typename T>
struct QMetaTypeId2<const T&> : QMetaTypeId2<T> {};
template <typename T>
struct QMetaTypeId2<T&> { enum {Defined = false }; };
namespace QtPrivate {
template <typename T, bool Defined = QMetaTypeId2<T>::Defined>
struct QMetaTypeIdHelper {