aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlproperty.cpp
diff options
context:
space:
mode:
authorOleg Shparber <trollixx@gmail.com>2014-06-24 17:03:08 -0700
committerOleg Shparber <trollixx@gmail.com>2014-06-25 17:31:47 +0200
commit435fb273355566c2888f8f685a369ce689869a14 (patch)
tree30ab03d005681f9a7666d5e76ad98bb419905263 /src/qml/qml/qqmlproperty.cpp
parent57e3ef14fdcf6ae337075b68d374827b12397a7d (diff)
Allow integer values to be assigned QList<qreal> properties
Before this patch it was not possible to assign an integer value to QList<qreal> property, while it worked for non-list properties. Change-Id: Iab00288f7d78f4f76056ab4291700d7f51626de4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r--src/qml/qml/qqmlproperty.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index 1075b53c5e..c9d5f76fbd 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -1427,7 +1427,8 @@ bool QQmlPropertyPrivate::write(QObject *object,
list << value.toInt();
v = QVariant::fromValue<QList<int> >(list);
ok = true;
- } else if (variantType == QVariant::Double && propertyType == qMetaTypeId<QList<qreal> >()) {
+ } else if ((variantType == QVariant::Double || variantType == QVariant::Int)
+ && (propertyType == qMetaTypeId<QList<qreal> >())) {
QList<qreal> list;
list << value.toReal();
v = QVariant::fromValue<QList<qreal> >(list);