summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetatype.cpp
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>2012-01-24 15:42:01 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-29 15:21:16 +0100
commitd874c059d36fe125c577dde9e980407fbd43beac (patch)
tree7fb31ae961414459ccb3a7364a9234ad8d45c7d5 /src/corelib/kernel/qmetatype.cpp
parentb08b254a798d2f4935ec770662c84d86bdfea97c (diff)
Introduce QTypeInfo::sizeOf.
In QMetaType "void" is a regular type, lack of c++ sizeof operator force us to write a template specialization for the type. Change-Id: I9a56e135223b416b8031836d29ef33ef3fb750e4 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qmetatype.cpp')
-rw-r--r--src/corelib/kernel/qmetatype.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index a0a1295426..38ca0211e5 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -1606,7 +1606,7 @@ namespace {
class SizeOf {
template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted>
struct SizeOfImpl {
- static int Size(const int) { return sizeof(T); }
+ static int Size(const int) { return QTypeInfo<T>::sizeOf; }
};
template<typename T>
struct SizeOfImpl<T, /* IsAcceptedType = */ false> {
@@ -1632,7 +1632,6 @@ public:
template<typename T>
int delegate(const T*) { return SizeOfImpl<T>::Size(m_type); }
- int delegate(const void*) { return 0; }
int delegate(const QMetaTypeSwitcher::UnknownType*) { return customTypeSizeOf(m_type); }
private:
static int customTypeSizeOf(const int type)