Delete sensors from model and storage
This commit is contained in:
parent
9afb2cbbac
commit
a182ba2111
2 changed files with 9 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ signals:
|
|||
|
||||
public slots:
|
||||
void push(const QScriptValue &v);
|
||||
void remove(int index);
|
||||
QVariant get(int index) const;
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue