diff --git a/telldus-gui/Plugins/QML/qmlarray.cpp b/telldus-gui/Plugins/QML/qmlarray.cpp index b36bfac8..8c46d294 100644 --- a/telldus-gui/Plugins/QML/qmlarray.cpp +++ b/telldus-gui/Plugins/QML/qmlarray.cpp @@ -35,6 +35,14 @@ void QMLArray::push(const QScriptValue &v) { endInsertRows(); } +void QMLArray::remove(int index) { + qDebug() << "Count first: " << d->list.count(); + beginRemoveRows( QModelIndex(), index, index ); + d->list.takeAt(index); + endRemoveRows(); + qDebug() << "Count after: " << d->list.size(); +} + int QMLArray::rowCount(const QModelIndex &parent) const { return d->list.size(); } diff --git a/telldus-gui/Plugins/QML/qmlarray.h b/telldus-gui/Plugins/QML/qmlarray.h index 8c29b798..25eb51f8 100644 --- a/telldus-gui/Plugins/QML/qmlarray.h +++ b/telldus-gui/Plugins/QML/qmlarray.h @@ -19,6 +19,7 @@ signals: public slots: void push(const QScriptValue &v); + void remove(int index); QVariant get(int index) const;