summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetatype.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <dangelog@gmail.com>2012-03-11 00:26:17 +0000
committerQt by Nokia <qt-info@nokia.com>2012-03-14 10:53:24 +0100
commit08790636f2b19a6bab97e3462211bec5b2d23c45 (patch)
tree77e6dc5a9b79e4c0e3462c6bf345d0283cde144b /src/corelib/kernel/qmetatype.cpp
parentb8112c8526a6e261c6e00bdb4fe6ceef3876d01f (diff)
QRegularExpression: QMetaType and QVariant support
Removed the Q_DECLARE_METATYPE in favour of first-class support inside QMetaType and QVariant. Change-Id: I904236822bfab967dc0fbd4d4cc2bcb68c741adc Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/corelib/kernel/qmetatype.cpp')
-rw-r--r--src/corelib/kernel/qmetatype.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 8474635fe7..a61894debd 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -63,6 +63,7 @@
# include "qurl.h"
# include "qvariant.h"
# include "qabstractitemmodel.h"
+# include "qregularexpression.h"
#endif
#ifndef QT_NO_GEOM_VARIANT
@@ -114,6 +115,9 @@ template<> struct TypeDefinition<QModelIndex> { static const bool IsAvailable =
#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
/*!
@@ -219,6 +223,7 @@ template<> struct TypeDefinition<QRegExp> { static const bool IsAvailable = fals
\value QPoint QPoint
\value QUrl QUrl
\value QRegExp QRegExp
+ \value QRegularExpression QRegularExpression
\value QDateTime QDateTime
\value QPointF QPointF
\value QPalette QPalette
@@ -781,10 +786,15 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data)
break;
#endif
#ifndef QT_BOOTSTRAPPED
+#ifndef QT_NO_REGEXP
+ case QMetaType::QRegularExpression:
+ stream << *static_cast<const NS(QRegularExpression)*>(data);
+ break;
+#endif // QT_NO_REGEXP
case QMetaType::QEasingCurve:
stream << *static_cast<const NS(QEasingCurve)*>(data);
break;
-#endif
+#endif // QT_BOOTSTRAPPED
case QMetaType::QFont:
case QMetaType::QPixmap:
case QMetaType::QBrush:
@@ -993,10 +1003,15 @@ bool QMetaType::load(QDataStream &stream, int type, void *data)
break;
#endif
#ifndef QT_BOOTSTRAPPED
+#ifndef QT_NO_REGEXP
+ case QMetaType::QRegularExpression:
+ stream >> *static_cast< NS(QRegularExpression)*>(data);
+ break;
+#endif // QT_NO_REGEXP
case QMetaType::QEasingCurve:
stream >> *static_cast< NS(QEasingCurve)*>(data);
break;
-#endif
+#endif // QT_BOOTSTRAPPED
case QMetaType::QFont:
case QMetaType::QPixmap:
case QMetaType::QBrush:
@@ -1149,9 +1164,13 @@ void *QMetaType::create(int type, const void *copy)
return new NS(QRegExp)(*static_cast<const NS(QRegExp)*>(copy));
#endif
#ifndef QT_BOOTSTRAPPED
+#ifndef QT_NO_REGEXP
+ case QMetaType::QRegularExpression:
+ return new NS(QRegularExpression)(*static_cast<const NS(QRegularExpression)*>(copy));
+#endif // QT_NO_REGEXP
case QMetaType::QEasingCurve:
return new NS(QEasingCurve)(*static_cast<const NS(QEasingCurve)*>(copy));
-#endif
+#endif // QT_BOOTSTRAPPED
case QMetaType::QUuid:
return new NS(QUuid)(*static_cast<const NS(QUuid)*>(copy));
#ifndef QT_BOOTSTRAPPED
@@ -1253,9 +1272,13 @@ void *QMetaType::create(int type, const void *copy)
return new NS(QRegExp);
#endif
#ifndef QT_BOOTSTRAPPED
+#ifndef QT_NO_REGEXP
+ case QMetaType::QRegularExpression:
+ return new NS(QRegularExpression);
+#endif // QT_NO_REGEXP
case QMetaType::QEasingCurve:
return new NS(QEasingCurve);
-#endif
+#endif // QT_BOOTSTRAPPED
case QMetaType::QUuid:
return new NS(QUuid);
#ifndef QT_BOOTSTRAPPED