diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-06-09 01:16:41 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-06-09 01:16:41 (GMT) |
commit | 991b41aa407b5a8740e6899a3efdc724276dcb95 (patch) | |
tree | 09704bd06a87731269f9571abd9943e010923853 /src/declarative/qml/qmlbasicscript.cpp | |
parent | ef4378dd282ed51098d1366792e46e9cfbde727a (diff) | |
download | Qt-991b41aa407b5a8740e6899a3efdc724276dcb95.zip Qt-991b41aa407b5a8740e6899a3efdc724276dcb95.tar.gz Qt-991b41aa407b5a8740e6899a3efdc724276dcb95.tar.bz2 |
Fix handling of qreal properties.
This is to bring us in line with the fix made to moc's handling of qreal
properties.
Diffstat (limited to 'src/declarative/qml/qmlbasicscript.cpp')
-rw-r--r-- | src/declarative/qml/qmlbasicscript.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/declarative/qml/qmlbasicscript.cpp b/src/declarative/qml/qmlbasicscript.cpp index 3d74b37..7bd898c 100644 --- a/src/declarative/qml/qmlbasicscript.cpp +++ b/src/declarative/qml/qmlbasicscript.cpp @@ -117,25 +117,25 @@ void QmlBasicScriptNodeCache::clear() static QVariant toObjectOrVariant(const QVariant &v) { - switch(v.type()) { + switch(v.userType()) { case QVariant::String: case QVariant::UInt: case QVariant::Int: - case 135: + case QMetaType::Float: case QVariant::Double: case QVariant::Color: case QVariant::Bool: default: - return v; - case QVariant::UserType: - { + { + if (v.type() == QVariant::UserType) { QObject *o = QmlMetaType::toQObject(v); if (o) return qVariantFromValue(o); else return v; } - break; + return v; + } } } @@ -166,7 +166,7 @@ static QVariant fetch_value(QObject *o, int idx, int type) return QVariant(val); } break; - case 135: + case QMetaType::Float: { float val; void *args[] = { &val, 0 }; |