summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetatype.cpp
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@digia.com>2012-09-21 13:45:07 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-27 02:37:19 +0200
commit60d096ff6d24a77f1c156c8354232a44e8516872 (patch)
treeacb952d2f87fae34b8f232d1c59fb840c3681286 /src/corelib/kernel/qmetatype.cpp
parentb5b8fdb915e7d57128b807f5640f418c2fd7cc85 (diff)
QMetaType build fix with Q_NO_CURSOR and friends.
QMetaType has a way to "switch off" some types from the build. QtMetaTypePrivate::TypeDefinition<T>::IsAvailable is defined as false for all unaccessible types. Sadly that information was never used by gui and widget handlers. The patch implements it. Change-Id: Ie5835be4c88cfbbca8a4e9199e31ddfc20cae190 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jing Bai <jing.bai@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qmetatype.cpp')
-rw-r--r--src/corelib/kernel/qmetatype.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index dc0fb73603..6194f20912 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -548,7 +548,9 @@ static int qMetaTypeCustomType_unlocked(const char *typeName, int length)
int QMetaType::registerType(const char *typeName, Deleter deleter,
Creator creator)
{
- return registerType(typeName, deleter, creator, qMetaTypeDestructHelper<void>, qMetaTypeConstructHelper<void>, 0, TypeFlags(), 0);
+ return registerType(typeName, deleter, creator,
+ QtMetaTypePrivate::QMetaTypeFunctionHelper<void>::Destruct,
+ QtMetaTypePrivate::QMetaTypeFunctionHelper<void>::Construct, 0, TypeFlags(), 0);
}
/*!
@@ -1233,7 +1235,7 @@ class TypeCreator {
struct CreatorImpl {
static void *Create(const int /* type */, const void *copy)
{
- // Using qMetaTypeCreateHelper<T> adds function call cost, even if it is a template (gcc).
+ // Using QMetaTypeFunctionHelper<T>::Create adds function call cost, even if it is a template (gcc).
// This "copy" check is moved out from the switcher by compiler (at least by gcc)
return copy ? new T(*static_cast<const T*>(copy)) : new T();
}
@@ -1298,7 +1300,7 @@ namespace {
class TypeDestroyer {
template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted>
struct DestroyerImpl {
- static void Destroy(const int /* type */, void *where) { qMetaTypeDeleteHelper<T>(where); }
+ static void Destroy(const int /* type */, void *where) { QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Delete(where); }
};
template<typename T>
struct DestroyerImpl<T, /* IsAcceptedType = */ false> {
@@ -1364,7 +1366,7 @@ namespace {
class TypeConstructor {
template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted>
struct ConstructorImpl {
- static void *Construct(const int /*type*/, void *where, const void *copy) { return qMetaTypeConstructHelper<T>(where, copy); }
+ static void *Construct(const int /*type*/, void *where, const void *copy) { return QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Construct(where, copy); }
};
template<typename T>
struct ConstructorImpl<T, /* IsAcceptedType = */ false> {
@@ -1452,7 +1454,7 @@ namespace {
class TypeDestructor {
template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted>
struct DestructorImpl {
- static void Destruct(const int /* type */, void *where) { qMetaTypeDestructHelper<T>(where); }
+ static void Destruct(const int /* type */, void *where) { QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Destruct(where); }
};
template<typename T>
struct DestructorImpl<T, /* IsAcceptedType = */ false> {