summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetatype.cpp
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>2012-03-23 17:14:52 +0100
committerQt by Nokia <qt-info@nokia.com>2012-04-03 03:29:55 +0200
commit4b023e248747a589f2402b03f1967b999e3bb3b8 (patch)
tree2da3714f8abfbdc8a22c06ccdd824a9937576009 /src/corelib/kernel/qmetatype.cpp
parent97f251b8c3654ffdf0ea3df3c610935549a7eba9 (diff)
Remove duplicated template code.
Unify TypeDefinitions specializations. I'm not aware of any reason why QVariant should have a separate set of supported types during bootstrapping phase. It would cause only crashes. As a side effect the patch reduces size of core and gui libraries. Change-Id: I5140d9d3daee39a0171bc718bf46dab6b28085ec Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qmetatype.cpp')
-rw-r--r--src/corelib/kernel/qmetatype.cpp45
1 files changed, 2 insertions, 43 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 7ddf187b88..fba1aaf9b6 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -54,11 +54,7 @@
#include "qvariant.h"
#include "qmetatypeswitcher_p.h"
-#ifdef QT_BOOTSTRAPPED
-# ifndef QT_NO_GEOM_VARIANT
-# define QT_NO_GEOM_VARIANT
-# endif
-#else
+#ifndef QT_BOOTSTRAPPED
# include "qbitarray.h"
# include "qurl.h"
# include "qvariant.h"
@@ -83,49 +79,12 @@ QT_BEGIN_NAMESPACE
namespace {
-template<typename T>
-struct TypeDefinition {
- static const bool IsAvailable = true;
-};
-
struct DefinedTypesFilter {
template<typename T>
struct Acceptor {
- static const bool IsAccepted = TypeDefinition<T>::IsAvailable && QTypeModuleInfo<T>::IsCore;
+ static const bool IsAccepted = QtMetaTypePrivate::TypeDefinition<T>::IsAvailable && QTypeModuleInfo<T>::IsCore;
};
};
-
-// Ignore these types, as incomplete
-#ifdef QT_NO_GEOM_VARIANT
-template<> struct TypeDefinition<QRect> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QRectF> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QSize> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QSizeF> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QLine> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QLineF> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QPoint> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QPointF> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_BOOTSTRAPPED
-template<> struct TypeDefinition<QVariantMap> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QVariantHash> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QVariantList> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QVariant> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QBitArray> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QUrl> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QEasingCurve> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QModelIndex> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QJsonValue> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QJsonObject> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QJsonArray> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QJsonDocument> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_REGEXP
-template<> struct TypeDefinition<QRegExp> { static const bool IsAvailable = false; };
-#endif
-#if defined(QT_BOOTSTRAPPED) || defined(QT_NO_REGEXP)
-template<> struct TypeDefinition<QRegularExpression> { static const bool IsAvailable = false; };
-#endif
} // namespace
/*!