Commit 56ac8bff authored by Don Gagne's avatar Don Gagne

Add deleteListAndContents

parent 97bfcb49
......@@ -220,3 +220,11 @@ void QmlObjectListModel::_childDirtyChanged(bool dirty)
// signal to know when a child has changed dirty state
emit dirtyChanged(_dirty);
}
void QmlObjectListModel::deleteListAndContents(void)
{
for (int i=0; i<_objectList.count(); i++) {
_objectList[i]->deleteLater();
}
deleteLater();
}
......@@ -60,6 +60,9 @@ public:
int indexOf(QObject* object) { return _objectList.indexOf(object); }
template<class T> T value(int index) { return qobject_cast<T>(_objectList[index]); }
/// Calls deleteLater on all items and this itself.
void deleteListAndContents(void);
signals:
void countChanged(int count);
void dirtyChanged(bool dirtyChanged);
......
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