Commit 7da536adaaa85ff549088722e3bbbdf19ad822c3

Authored by Brendan K
2 parents b2b9273c 4f2d5fdc

Merge pull request #256 from biometrics/qvariant_parsing

added logic to parse QVariantLists
Showing 1 changed file with 4 additions and 2 deletions
openbr/openbr_plugin.cpp
... ... @@ -804,7 +804,7 @@ void Object::setProperty(const QString &name, QVariant value)
804 804 int v = value.toInt(&ok);
805 805 if (ok)
806 806 value = v;
807   - } else if ((type.startsWith("QList<") && type.endsWith(">")) || (type == "QStringList")) {
  807 + } else if ((type.startsWith("QList<") && type.endsWith(">")) || (type == "QStringList") || (type == "QVariantList")) {
808 808 QVariantList elements;
809 809 if (value.canConvert<QVariantList>()) {
810 810 elements = value.value<QVariantList>();
... ... @@ -821,7 +821,9 @@ void Object::setProperty(const QString &amp;name, QVariant value)
821 821 qFatal("Expected a list.");
822 822 }
823 823  
824   - if ((type == "QList<QString>") || (type == "QStringList")) {
  824 + if ((type == "QList<QVariant>") || (type == "QVariantList")) {
  825 + value.setValue(elements);
  826 + } else if ((type == "QList<QString>") || (type == "QStringList")) {
825 827 QStringList parsedValues;
826 828 foreach (const QVariant &element, elements)
827 829 parsedValues.append(element.toString());
... ...