summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlbasicscript.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-06-09 01:16:41 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-06-09 01:16:41 (GMT)
commit991b41aa407b5a8740e6899a3efdc724276dcb95 (patch)
tree09704bd06a87731269f9571abd9943e010923853 /src/declarative/qml/qmlbasicscript.cpp
parentef4378dd282ed51098d1366792e46e9cfbde727a (diff)
downloadQt-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.cpp14
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 };