diff --git a/src/core/scriptmodel.cpp b/src/core/scriptmodel.cpp index 9b6eb01..fae65dd 100644 --- a/src/core/scriptmodel.cpp +++ b/src/core/scriptmodel.cpp @@ -13,7 +13,7 @@ #include #include -bool ScriptModel::updateValuesUnique(const QJSValueList& newValues) { +bool ScriptModel::updateValuesUnique(const QList& newValues) { auto anyChanges = false; this->hasActiveIterators = true; @@ -163,7 +163,7 @@ bool ScriptModel::updateValuesUnique(const QJSValueList& newValues) { return anyChanges; } -void ScriptModel::setValues(const QJSValueList& newValues) { +void ScriptModel::setValues(const QList& newValues) { auto changed = this->updateValuesUnique(newValues); if (changed) emit this->valuesChanged(); } diff --git a/src/core/scriptmodel.hpp b/src/core/scriptmodel.hpp index 9a445cb..b3254fb 100644 --- a/src/core/scriptmodel.hpp +++ b/src/core/scriptmodel.hpp @@ -71,7 +71,7 @@ class ScriptModel: public QAbstractListModel { /// > } /// > ``` // TODO: use qjsobject for gc/free checks? - Q_PROPERTY(QJSValueList values READ values WRITE setValues NOTIFY valuesChanged); + Q_PROPERTY(QList values READ values WRITE setValues NOTIFY valuesChanged); /// The property that javascript objects passed into the model will be compared with. /// /// For example, if `objectProp` is `"myprop"` then `{ myprop: "a", other: "y" }` and @@ -82,14 +82,14 @@ class ScriptModel: public QAbstractListModel { QML_ELEMENT; public: - [[nodiscard]] QJSValueList values() const { + [[nodiscard]] QList values() const { auto values = this->mValues; // If not detached, the QML engine will invalidate iterators in updateValuesUnique. if (this->hasActiveIterators) values.detach(); return values; } - void setValues(const QJSValueList& newValues); + void setValues(const QList& newValues); [[nodiscard]] QString objectProp() const { return this->cmpKey; } void setObjectProp(const QString& objectProp); @@ -103,9 +103,9 @@ signals: void objectPropChanged(); private: - QJSValueList mValues; + QList mValues; QString cmpKey; bool hasActiveIterators = false; - bool updateValuesUnique(const QJSValueList& newValues); + bool updateValuesUnique(const QList& newValues); };