Delete sensors from model and storage

This commit is contained in:
Stefan Persson 2012-01-17 13:16:10 +01:00
parent 9afb2cbbac
commit a182ba2111
2 changed files with 9 additions and 0 deletions

View file

@ -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();
}

View file

@ -19,6 +19,7 @@ signals:
public slots:
void push(const QScriptValue &v);
void remove(int index);
QVariant get(int index) const;