diff --git a/harmonyqml/backend/model/list_model.py b/harmonyqml/backend/model/list_model.py index 5d37e41c..53e6caed 100644 --- a/harmonyqml/backend/model/list_model.py +++ b/harmonyqml/backend/model/list_model.py @@ -357,6 +357,9 @@ class ListModel(QAbstractListModel): @pyqtSlot() def clear(self) -> None: + if not self._data: + return + # Reimplemented for performance reasons (begin/endRemoveRows) self.beginRemoveRows(QModelIndex(), 0, len(self)) self._data.clear()