diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-04-26 11:05:41 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-30 01:52:57 +0200 |
commit | 0e8af75e877d46cb656d03cf575804f2c17ec33f (patch) | |
tree | 6b3466202d1a62b7c5d7fb5aff904599ee8d3ca5 /src/qml/qml/qqmlglobal.cpp | |
parent | 1b48bb5602bd90dc78e1ff09207f682f6a43edd2 (diff) |
Ensure external value types are initialized before write
Ensure that the logic used when writing to a property having a value
type provided by an external module matches that used for properties
of internal value types.
Change-Id: I925b8b30a211ef813e2a51134411a162b0b146b5
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlglobal.cpp')
-rw-r--r-- | src/qml/qml/qqmlglobal.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlglobal.cpp b/src/qml/qml/qqmlglobal.cpp index 1f8de4fae8..c5228d07c3 100644 --- a/src/qml/qml/qqmlglobal.cpp +++ b/src/qml/qml/qqmlglobal.cpp @@ -175,6 +175,20 @@ QVariant QQmlValueTypeProvider::createVariantFromString(int type, const QString return QVariant(); } +bool QQmlValueTypeProvider::equalValueType(int type, const void *lhs, const void *rhs) +{ + Q_ASSERT(lhs); + Q_ASSERT(rhs); + + QQmlValueTypeProvider *p = this; + do { + if (p->equal(type, lhs, rhs)) + return true; + } while ((p = p->next)); + + return false; +} + bool QQmlValueTypeProvider::storeValueType(int type, const void *src, void *dst, size_t n) { Q_ASSERT(src); @@ -226,6 +240,7 @@ bool QQmlValueTypeProvider::createFromString(int, const QString &, void *, size_ bool QQmlValueTypeProvider::createStringFrom(int, const void *, QString *) { return false; } bool QQmlValueTypeProvider::variantFromString(const QString &, QVariant *) { return false; } bool QQmlValueTypeProvider::variantFromString(int, const QString &, QVariant *) { return false; } +bool QQmlValueTypeProvider::equal(int, const void *, const void *) { return false; } bool QQmlValueTypeProvider::store(int, const void *, void *, size_t) { return false; } bool QQmlValueTypeProvider::read(int, const void *, int, void *) { return false; } bool QQmlValueTypeProvider::write(int, const void *, void *, size_t) { return false; } |