Commit 5b95dcf3 authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Add VariantListModel.contains(var)

parent 80a0bf55
......@@ -20,6 +20,8 @@ public:
virtual int count (void) const = 0;
Q_INVOKABLE virtual bool contains (const QVariant & value) const = 0;
Q_INVOKABLE virtual QVariant get (const int idx) const = 0;
signals:
......@@ -153,6 +155,9 @@ public:
QVariant get (const int idx) const final {
return QVariant::fromValue (at (idx));
}
bool contains (const QVariant & var) const final {
return (m_items.contains (var.value<T> ()));
}
protected:
static const QModelIndex & ROOT (void) {
......
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