summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlvmemetaobject.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 00:31:46 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 00:31:46 (GMT)
commitde4d752b3b1c475e1d5b7bf1539fa6a80a52ba1d (patch)
tree4aef2abd415d898f87ce50e68b68f17e483ff79f /src/declarative/qml/qmlvmemetaobject.cpp
parenta700d7c263748d3635eb06a7091164fd75ec608c (diff)
parenteca4d3662d61aea60478772d8cfa477642d284df (diff)
downloadQt-de4d752b3b1c475e1d5b7bf1539fa6a80a52ba1d.zip
Qt-de4d752b3b1c475e1d5b7bf1539fa6a80a52ba1d.tar.gz
Qt-de4d752b3b1c475e1d5b7bf1539fa6a80a52ba1d.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml/qmlvmemetaobject.cpp')
-rw-r--r--src/declarative/qml/qmlvmemetaobject.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlvmemetaobject.cpp b/src/declarative/qml/qmlvmemetaobject.cpp
index a324795..e5acc51 100644
--- a/src/declarative/qml/qmlvmemetaobject.cpp
+++ b/src/declarative/qml/qmlvmemetaobject.cpp
@@ -100,6 +100,24 @@ QmlVMEMetaObject::~QmlVMEMetaObject()
int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
{
int id = _id;
+ if(c == QMetaObject::WriteProperty) {
+ int flags = *reinterpret_cast<int*>(a[3]);
+ if (!(flags & QmlMetaProperty::BypassInterceptor)
+ && !aInterceptors.isEmpty()
+ && aInterceptors.testBit(id)) {
+ QmlPropertyValueInterceptor *vi = interceptors.value(id);
+ if (id >= propOffset) {
+ id -= propOffset;
+ if (id < metaData->propertyCount) {
+ vi->write(QVariant(data[id].type(), a[0]));
+ return -1;
+ }
+ } else {
+ vi->write(QVariant(property(id).type(), a[0]));
+ return -1;
+ }
+ }
+ }
if(c == QMetaObject::ReadProperty || c == QMetaObject::WriteProperty) {
if (id >= propOffset) {
id -= propOffset;
@@ -265,4 +283,13 @@ void QmlVMEMetaObject::listChanged(int id)
activate(object, methodOffset + id, 0);
}
+void QmlVMEMetaObject::registerInterceptor(int index, QmlPropertyValueInterceptor *interceptor)
+{
+ if (aInterceptors.isEmpty())
+ aInterceptors.resize(propertyCount() + metaData->propertyCount);
+ aInterceptors.setBit(index);
+ interceptors.insert(index, interceptor);
+}
+
+
QT_END_NAMESPACE