summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-01-11 09:01:26 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-01-11 09:01:26 (GMT)
commite9e94a3f6c77735e65353c78075cb411ba747f63 (patch)
treeb33a921d941b13ef747b24eb2fb95b921c2d8dd8 /src/declarative
parent2e3fea996697b89d869eaed4c2c5996fb3a6f503 (diff)
downloadQt-e9e94a3f6c77735e65353c78075cb411ba747f63.zip
Qt-e9e94a3f6c77735e65353c78075cb411ba747f63.tar.gz
Qt-e9e94a3f6c77735e65353c78075cb411ba747f63.tar.bz2
More binding opts
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qmlbindingvme.cpp17
1 files changed, 17 insertions, 0 deletions
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>()) {
((QVariant *)registers[instr->cleanup.reg].typeDataPtr())->~QVariant();
+ } else if (type == QMetaType::QString) {
+ ((QString *)registers[instr->cleanup.reg].typeDataPtr())->~QString();
}
}
break;