From e9e94a3f6c77735e65353c78075cb411ba747f63 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 Jan 2010 19:01:26 +1000 Subject: More binding opts --- src/declarative/qml/qmlbindingvme.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/declarative/qml/qmlbindingvme.cpp b/src/declarative/qml/qmlbindingvme.cpp index 493aeaf..81e05c1 100644 --- a/src/declarative/qml/qmlbindingvme.cpp +++ b/src/declarative/qml/qmlbindingvme.cpp @@ -472,6 +472,19 @@ static bool findproperty(QObject *obj, Register *output, void *args[] = { output->typeDataPtr(), 0 }; QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args); output->settype(QMetaType::QReal); + } else if (property->propType == QMetaType::Int) { + void *args[] = { output->typeDataPtr(), 0 }; + QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args); + output->settype(QMetaType::Int); + } else if (property->propType == QMetaType::Bool) { + void *args[] = { output->typeDataPtr(), 0 }; + QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args); + output->settype(QMetaType::Bool); + } else if (property->propType == QMetaType::QString) { + new (output->typeDataPtr()) QString(); + void *args[] = { output->typeDataPtr(), 0 }; + QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args); + output->settype(QMetaType::QString); } else { new (output->typeDataPtr()) QVariant(obj->metaObject()->property(property->coreIndex).read(obj)); @@ -623,6 +636,8 @@ inline static QUrl toUrl(Register *reg, int type, QmlContextPrivate *context, bo if (ok) *ok = false; return QUrl(); } + } else if (type == QMetaType::QString) { + base = QUrl(*reg->getstringptr()); } else { if (ok) *ok = false; return QUrl(); @@ -881,6 +896,8 @@ void QmlBindingVME::run(const char *programData, int instrIndex, int type = registers[instr->cleanup.reg].gettype(); if (type == qMetaTypeId()) { ((QVariant *)registers[instr->cleanup.reg].typeDataPtr())->~QVariant(); + } else if (type == QMetaType::QString) { + ((QString *)registers[instr->cleanup.reg].typeDataPtr())->~QString(); } } break; -- cgit v0.12