diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-23 16:39:29 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-23 16:43:58 +0200 |
commit | e2736212a7762d8c6d474d64bec1df87799cf33b (patch) | |
tree | 9d5c88e10d32fd872c3ab6b8d312fc9f350c26d4 /src/qml/qml/qqmlproperty.cpp | |
parent | 3eed20c22ee046c42fec81b0d9d6e47a27bdbe03 (diff) | |
parent | 8eeede619f417904cbd33fd44143f857dfce0996 (diff) |
Merge branch remote-tracking branch '5.8' into wip/pointerhandler
Change-Id: I1750ed28c5fda878a0a8f2b7bfe4c580c0b7ffe3
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 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; |