diff options
author | Liang Qi <liang.qi@qt.io> | 2016-08-13 00:41:58 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-08-13 00:41:58 +0200 |
commit | d54d28981c90d23d7fa0cfc5a9e3049e3e4df6b5 (patch) | |
tree | 0eb2f54f16b014f6eaa362095393d1bd058adb52 /src/qml/qml/qqmlproperty.cpp | |
parent | 580f2872f09cf7ad83ec9ae5dca686683a3cac80 (diff) | |
parent | 6f15de1d2da9c83d7fca1d5c8243c0d69a1390ee (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
src/qml/compiler/qv4isel_moth.cpp
src/qml/compiler/qv4ssa_p.h
tests/benchmarks/qml/qqmlimage/qqmlimage.pro
tests/benchmarks/qml/qqmlimage/tst_qqmlimage.cpp
Change-Id: Iad11ce7fdf0c6d200fdebc16a94081bd8069a87a
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r-- | src/qml/qml/qqmlproperty.cpp | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index df2ff05de1..0ef0a5b16e 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -1334,29 +1334,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; |