diff options
author | Liang Qi <liang.qi@qt.io> | 2016-08-17 10:57:38 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-08-17 10:57:38 +0200 |
commit | 7e609f6d109f8bebb7e2fe4bd8867c5a4f8ece3d (patch) | |
tree | ecbd4f56e83a84233d42928e5554709ca8832ce1 /src/qml/qml | |
parent | 78f5b9e7f7295b9ba11da6908713fb938a1e0b90 (diff) | |
parent | c0f3c8ae5cee3ecda1ac8829336aa95cbe4d330e (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
src/qml/compiler/qqmltypecompiler.cpp
src/qml/compiler/qv4isel_moth.cpp
src/qml/compiler/qv4ssa_p.h
src/qml/qml/qqmlobjectcreator.cpp
Change-Id: I8bb7fe773d657f908f20ee5e72c2b9bd643f6260
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 10 | ||||
-rw-r--r-- | src/qml/qml/qqmlproperty.cpp | 25 |
2 files changed, 7 insertions, 28 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index f9794ec26a..e02d362815 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -75,12 +75,12 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QV4::Compil , compilationUnit(compilationUnit) , resolvedTypes(compilationUnit->resolvedTypes) , propertyCaches(&compilationUnit->propertyCaches) + , sharedState(new QQmlObjectCreatorSharedState) + , topLevelCreator(true) , activeVMEDataForRootContext(activeVMEDataForRootContext) { init(parentContext); - sharedState = new QQmlObjectCreatorSharedState; - topLevelCreator = true; sharedState->componentAttached = 0; sharedState->allCreatedBindings.allocate(compilationUnit->totalBindingsCount); sharedState->allParserStatusCallbacks.allocate(compilationUnit->totalParserStatusCount); @@ -102,12 +102,11 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QV4::Compil , compilationUnit(compilationUnit) , resolvedTypes(compilationUnit->resolvedTypes) , propertyCaches(&compilationUnit->propertyCaches) + , sharedState(inheritedSharedState) + , topLevelCreator(false) , activeVMEDataForRootContext(0) { init(parentContext); - - sharedState = inheritedSharedState; - topLevelCreator = false; } void QQmlObjectCreator::init(QQmlContextData *providedParentContext) @@ -123,6 +122,7 @@ void QQmlObjectCreator::init(QQmlContextData *providedParentContext) context = 0; _qobject = 0; _scopeObject = 0; + _bindingTarget = 0; _valueTypeProperty = 0; _compiledObject = 0; _compiledObjectIndex = -1; diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index 7b1e2ec4f6..c62fef7c3d 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -1321,29 +1321,8 @@ bool QQmlPropertyPrivate::write(QObject *object, bool ok = false; QVariant v; - if (variantType == QVariant::String) { - const QString &str = value.toString(); - const bool targetIsChar = (propertyType == qMetaTypeId<QChar>() - || propertyType == qMetaTypeId<char>() - || propertyType == qMetaTypeId<unsigned char>()); - // If the string contains only one character and the target is a char, try converting it. - if (targetIsChar) { - if (str.size() != 1) - return false; // We can only convert if the string contains exactly one character. - - const QChar &qChar = str.at(0); - if (propertyType == qMetaTypeId<QChar>()) { - v = qChar; - ok = true; - } else if (propertyType == qMetaTypeId<char>() || propertyType == qMetaTypeId<unsigned char>()) { - const char c = qChar.toLatin1(); - v = c; - ok = (qChar == c); - } - } else { - v = QQmlStringConverters::variantFromString(str, propertyType, &ok); - } - } + if (variantType == QVariant::String) + v = QQmlStringConverters::variantFromString(value.toString(), propertyType, &ok); if (!ok) { v = value; |