diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2014-08-10 23:16:51 +0200 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2014-08-13 17:23:24 +0200 |
commit | 72c99dd4463bc41097d3bf68aa21c703ee036b2b (patch) | |
tree | 3e182c78c7ec5f561fe3d5c40367d5a24e9c1e94 /src/corelib/kernel/qmetatype.h | |
parent | b2a7d865b2660d83fa899a213826525788d66b95 (diff) |
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>
Diffstat (limited to 'src/corelib/kernel/qmetatype.h')
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 32fd5bd153..1aa89a03b3 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -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 { |