aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativemetatype.cpp
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2011-11-22 15:10:42 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-23 10:03:40 +0100
commit384fd7cdf1cb3061126c74c4f591cd2c0acdfedc (patch)
tree3ca056562d4fc9e12a8c982f7f4956ddba556d8c /src/declarative/qml/qdeclarativemetatype.cpp
parent23a6a1c26b3206a53f8b3019c3a7dcff8a623a24 (diff)
v4: Get rid of dependency on QQuickAnchorLine type
Delegate the meta-type id query and value comparison to QDeclarativeMetaType. Register a comparison function for QQuickAnchorLine in QQuickItemsModule, so that not even QDeclarativeMetaType needs to know the type declaration. (This is needed in order to be able to move the items to a separate library.) Change-Id: I6404d01b74143946ae0a79fa18d1777b675e4194 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativemetatype.cpp')
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index 9e178c630e..46395e15e8 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -1894,4 +1894,27 @@ bool QDeclarativeMetaType::copy(int type, void *data, const void *copy)
return false;
}
+int QDeclarativeMetaType::QQuickAnchorLineMetaTypeId()
+{
+ static int id = 0;
+ if (!id) {
+ id = QMetaType::type("QQuickAnchorLine");
+ Q_ASSERT(id != 0);
+ }
+ return id;
+}
+
+QDeclarativeMetaType::CompareFunction QDeclarativeMetaType::anchorLineCompareFunction = 0;
+
+void QDeclarativeMetaType::setQQuickAnchorLineCompareFunction(CompareFunction fun)
+{
+ anchorLineCompareFunction = fun;
+}
+
+bool QDeclarativeMetaType::QQuickAnchorLineCompare(const void *p1, const void *p2)
+{
+ Q_ASSERT(anchorLineCompareFunction != 0);
+ return anchorLineCompareFunction(p1, p2);
+}
+
QT_END_NAMESPACE