diff --git a/sdk/openbr_plugin.cpp b/sdk/openbr_plugin.cpp index a3b2eac..8c42988 100644 --- a/sdk/openbr_plugin.cpp +++ b/sdk/openbr_plugin.cpp @@ -455,6 +455,8 @@ QString Object::argument(int index) const return "[" + strings.join(",") + "]"; } else if (type == "br::Transform*") { return variant.value()->description(); + } else if (type == "QStringList") { + return "[" + variant.toStringList().join(",") + "]"; } return variant.toString(); @@ -488,6 +490,10 @@ void Object::store(QDataStream &stream) const stream << property.read(this).toFloat(); } else if (type == "double") { stream << property.read(this).toDouble(); + } else if (type == "QString") { + stream << property.read(this).toString(); + } else if (type == "QStringList") { + stream << property.read(this).toStringList(); } else { qFatal("Can't serialize value of type: %s", qPrintable(type)); } @@ -524,6 +530,14 @@ void Object::load(QDataStream &stream) double value; stream >> value; property.write(this, value); + } else if (type == "QString") { + QString value; + stream >> value; + property.write(this, value); + } else if (type == "QStringList") { + QStringList value; + stream >> value; + property.write(this, value); } else { qFatal("Can't serialize value of type: %s", qPrintable(type)); } @@ -564,6 +578,8 @@ void Object::setProperty(const QString &name, const QString &value) } } else if (type == "br::Transform*") { variant.setValue(Transform::make(value, this)); + } else if (type == "QStringList") { + variant.setValue(parse(value.mid(1, value.size()-2))); } else if (type == "bool") { if (value.isEmpty()) variant = true; else if (value == "false") variant = false; diff --git a/sdk/openbr_plugin.h b/sdk/openbr_plugin.h index f3e28e1..7a6debd 100644 --- a/sdk/openbr_plugin.h +++ b/sdk/openbr_plugin.h @@ -485,6 +485,12 @@ public: Q_PROPERTY(bool enrollAll READ get_enrollAll WRITE set_enrollAll RESET reset_enrollAll) BR_PROPERTY(bool, enrollAll, false) + /*! + * \brief Keys to use when matching templates to automatically determine non-match based on template metadata. + */ + Q_PROPERTY(QStringList demographicFilters READ get_demographicFilters WRITE set_demographicFilters) + BR_PROPERTY(QStringList, demographicFilters, QStringList()) + QHash abbreviations; /*!< \brief Used by br::Transform::make() to expand abbreviated algorithms into their complete definitions. */ QHash classes; /*!< \brief Used by classifiers to associate text class labels with unique integers IDs. */ QTime startTime; /*!< \brief Used to estimate timeRemaining(). */