diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-02-09 21:39:42 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-02-09 21:39:42 (GMT) |
commit | 4adf3144d79cf3affe2b83dabf5333134b6ec6f7 (patch) | |
tree | e6b0a817300eb4a195ee92e5c6c6a19ed4a36f60 /src/declarative/qml/qmlvme.cpp | |
parent | 9a3b5988a089429e016334a434023bc5c992f0ed (diff) | |
parent | 969b61f508294d1f683e09e78641127d0f0def05 (diff) | |
download | Qt-4adf3144d79cf3affe2b83dabf5333134b6ec6f7.zip Qt-4adf3144d79cf3affe2b83dabf5333134b6ec6f7.tar.gz Qt-4adf3144d79cf3affe2b83dabf5333134b6ec6f7.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Diffstat (limited to 'src/declarative/qml/qmlvme.cpp')
-rw-r--r-- | src/declarative/qml/qmlvme.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index e9a0449..4ab205e 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -91,14 +91,15 @@ QmlVME::QmlVME() struct ListInstance { - ListInstance() {} - ListInstance(QList<void *> *q, int t) - : type(t), qListInterface(q), qmlListInterface(0) {} + ListInstance() + : type(0), qmlListInterface(0) {} + ListInstance(int t) + : type(t), qmlListInterface(0) {} ListInstance(QmlPrivate::ListInterface *q, int t) - : type(t), qListInterface(0), qmlListInterface(q) {} + : type(t), qmlListInterface(q) {} int type; - QList<void *> *qListInterface; + QmlListProperty<void> qListProperty; QmlPrivate::ListInterface *qmlListInterface; }; @@ -669,7 +670,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt, QObject *assign = stack.pop(); const ListInstance &list = qliststack.top(); - list.qListInterface->append((void *)assign); + list.qListProperty.append((QmlListProperty<void>*)&list.qListProperty, assign); } break; @@ -694,7 +695,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt, void *d = (void *)&ptr; list.qmlListInterface->append(d); } else { - list.qListInterface->append(ptr); + list.qListProperty.append((QmlListProperty<void>*)&list.qListProperty, ptr); } } break; @@ -772,17 +773,12 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt, { QObject *target = stack.top(); + qliststack.push(ListInstance(instr.fetchQmlList.type)); + void *a[1]; - // We know that QList<T *>* can be converted to - // QList<void *>* - QList<void *> *list = 0; - a[0] = &list; + a[0] = (void *)&(qliststack.top().qListProperty); QMetaObject::metacall(target, QMetaObject::ReadProperty, instr.fetchQmlList.property, a); - if (!list) - VME_EXCEPTION(QCoreApplication::translate("QmlVME","Cannot assign to null list")); - - qliststack.push(ListInstance(list, instr.fetchQmlList.type)); } break; |