summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetatype_p.h
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-03-31 08:48:56 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2020-06-02 22:42:15 +0200
commit47c6466d0acc6d8d733b4fdbaf980a60bbfc93ef (patch)
tree31aad5a433def4b15fbfca44d5be1e0f94f3fcfd /src/corelib/kernel/qmetatype_p.h
parent649d834443326bfef6ad296cd53819121b8d1a17 (diff)
QMetaType: create metatype for void
Create a QMetaTypeInterface for void. This allows us differentiate QMetaType::Unknown from QMetaType::Void. In addition, this will enable the usage of QMetaMethod::metaReturnType in QMetaMethod::returnType, and will facilitate using metaReturnType in declarative, which needs to distinguish between Unknown and Void. Change-Id: I83296b49587f3deb7ec73e25a33f0d8c98cf8da0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetatype_p.h')
-rw-r--r--src/corelib/kernel/qmetatype_p.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/corelib/kernel/qmetatype_p.h b/src/corelib/kernel/qmetatype_p.h
index 8e08d84ffd..2f4d69488f 100644
--- a/src/corelib/kernel/qmetatype_p.h
+++ b/src/corelib/kernel/qmetatype_p.h
@@ -192,9 +192,7 @@ template<> struct TypeDefinition<QIcon> { static const bool IsAvailable = false;
template<typename T>
static QT_PREPEND_NAMESPACE(QtPrivate::QMetaTypeInterface) *getInterfaceFromType()
{
- if constexpr (std::is_same_v<T, void>) {
- return nullptr;
- } else if constexpr (QtMetaTypePrivate::TypeDefinition<T>::IsAvailable) {
+ if constexpr (QtMetaTypePrivate::TypeDefinition<T>::IsAvailable) {
return &QT_PREPEND_NAMESPACE(QtPrivate::QMetaTypeForType)<T>::metaType;
}
return nullptr;