Move QIcon metatype handlers back to QtGui
[profile/ivi/qtbase.git] / src / corelib / kernel / qmetatype_p.h
index b50521c..cffc45c 100644 (file)
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
 namespace QModulesPrivate {
 enum Names { Core, Gui, Widgets, Unknown, ModulesCount /* ModulesCount has to be at the end */ };
 
-static inline int moduleForType(const int typeId)
+static inline int moduleForType(const uint typeId)
 {
     if (typeId <= QMetaType::LastCoreType)
         return Core;
@@ -70,7 +70,6 @@ static inline int moduleForType(const int typeId)
         return Widgets;
     return Unknown;
 }
-}
 
 template <typename T>
 class QTypeModuleInfo
@@ -114,6 +113,7 @@ QT_FOR_EACH_STATIC_CORE_CLASS(QT_DECLARE_CORE_MODULE_TYPES_ITER)
 QT_FOR_EACH_STATIC_CORE_TEMPLATE(QT_DECLARE_CORE_MODULE_TYPES_ITER)
 QT_FOR_EACH_STATIC_GUI_CLASS(QT_DECLARE_GUI_MODULE_TYPES_ITER)
 QT_FOR_EACH_STATIC_WIDGETS_CLASS(QT_DECLARE_WIDGETS_MODULE_TYPES_ITER)
+} // namespace QModulesPrivate
 
 #undef QT_DECLARE_CORE_MODULE_TYPES_ITER
 #undef QT_DECLARE_GUI_MODULE_TYPES_ITER
@@ -155,9 +155,7 @@ public:
     /*constructor*/(qMetaTypeConstructHelper<Type>), \
     /*destructor*/(qMetaTypeDestructHelper<Type>), \
     /*size*/(QTypeInfo<Type>::sizeOf), \
-    /*flags*/(!QTypeInfo<Type>::isStatic * QMetaType::MovableType) \
-            | (QTypeInfo<Type>::isComplex * QMetaType::NeedsConstruction) \
-            | (QTypeInfo<Type>::isComplex * QMetaType::NeedsDestruction) \
+    /*flags*/QtPrivate::QMetaTypeTypeFlags<Type>::Flags \
 }
 
 
@@ -184,6 +182,65 @@ public:
     /*flags*/ 0 \
 }
 
+namespace QtMetaTypePrivate {
+template<typename T>
+struct TypeDefinition {
+    static const bool IsAvailable = true;
+};
+
+// Ignore these types, as incomplete
+#ifdef QT_BOOTSTRAPPED
+template<> struct TypeDefinition<QBitArray> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QEasingCurve> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QJsonArray> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QJsonDocument> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QJsonObject> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QJsonValue> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QModelIndex> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QUrl> { static const bool IsAvailable = false; };
+#endif
+#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_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
+#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
+#ifdef QT_NO_ICON
+template<> struct TypeDefinition<QIcon> { static const bool IsAvailable = false; };
+#endif
+} //namespace QtMetaTypePrivate
+
 QT_END_NAMESPACE
 
 #endif // QMETATYPE_P_H