summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguivariant.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/gui/kernel/qguivariant.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/gui/kernel/qguivariant.cpp')
-rw-r--r--src/gui/kernel/qguivariant.cpp41
1 files changed, 1 insertions, 40 deletions
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index 531afeef2d..436688a295 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -98,52 +98,13 @@ QT_BEGIN_NAMESPACE
Q_CORE_EXPORT const QVariant::Handler *qcoreVariantHandler();
namespace {
-template<typename T>
-struct TypeDefinition {
- static const bool IsAvailable = true;
-};
-// 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_NO_SHORTCUT
-template<> struct TypeDefinition<QKeySequence> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_CURSOR
-template<> struct TypeDefinition<QCursor> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_MATRIX4X4
-template<> struct TypeDefinition<QMatrix4x4> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_VECTOR2D
-template<> struct TypeDefinition<QVector2D> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_VECTOR3D
-template<> struct TypeDefinition<QVector3D> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_VECTOR4D
-template<> struct TypeDefinition<QVector4D> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_QUATERNION
-template<> struct TypeDefinition<QQuaternion> { static const bool IsAvailable = false; };
-#endif
-
struct GuiTypesFilter {
template<typename T>
struct Acceptor {
- static const bool IsAccepted = QTypeModuleInfo<T>::IsGui && TypeDefinition<T>::IsAvailable;
+ static const bool IsAccepted = QTypeModuleInfo<T>::IsGui && QtMetaTypePrivate::TypeDefinition<T>::IsAvailable;
};
};
-} // namespace used to hide TypeDefinition
-namespace {
static void construct(QVariant::Private *x, const void *copy)
{
const int type = x->type;