Commit 2e7d6bdd authored by Wouter's avatar Wouter

Correct list conversion

parent b752131e
......@@ -35,8 +35,8 @@ QVariant {{ class.fullName }}::toVariant() const
bool valuesOk = true;
{{ class.fullName }} result;
if (value.canConvert(QMetaType::QVariantList)) {
Q_FOREACH(const QVariant& itemValue, value.toList()) {
if (value.canConvert<QVariantList>()) {
Q_FOREACH(const QVariant& itemValue, value.value<QSequentialIterable>()) {
{% switch class.itemType.type.metaType %}
{% default %}
{{ class.itemType.type.fullName }} itemResult = {{ class.itemType.type.fullName }}::fromVariant(itemValue, &valuesOk);
......@@ -53,6 +53,9 @@ QVariant {{ class.fullName }}::toVariant() const
{% endswitch %}
}
}
else {
valuesOk = false;
}
if (ok != NULL) {
*ok = valuesOk;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment