summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qmlengine.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index 36b6424..8c926b7 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -1160,14 +1160,26 @@ QVariant QmlExpression::value()
}
rv = QVariant::fromValue(list);
}
- } else if (svalue.isObject()) {
+ } else if (svalue.isObject() &&
+ !svalue.isNumber() &&
+ !svalue.isString() &&
+ !svalue.isDate() &&
+ !svalue.isError() &&
+ !svalue.isFunction() &&
+ !svalue.isNull() &&
+ !svalue.isQMetaObject() &&
+ !svalue.isQObject() &&
+ !svalue.isRegExp()) {
QScriptValue objValue = svalue.data();
- if (objValue.isValid())
- rv = objValue.toVariant();
+ if (objValue.isValid()) {
+ QVariant var = objValue.toVariant();
+ if (var.userType() >= (int)QVariant::UserType &&
+ QmlMetaType::isObject(var.userType()))
+ rv = var;
+ }
}
- if (rv.isNull()) {
+ if (rv.isNull())
rv = svalue.toVariant();
- }
for (int i = 0; i < context()->d_func()->scopeChain.size(); ++i) {
scriptEngine->currentContext()->popScope();