QmlDesigner: remove unclear "clearItems" function

It calls reset this model which is destructing at this moment.
There is no need to delete the items because they are objects
with the model as the parent.

Change-Id: I32be59238ea174faf66ce62ae9cd3ab02812d283
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Tim Jenssen
2020-03-25 19:30:08 +01:00
parent 91d6214b58
commit 8b0cece0ba
2 changed files with 0 additions and 9 deletions

View File

@@ -39,7 +39,6 @@ ItemLibrarySectionModel::ItemLibrarySectionModel(QObject *parent) :
ItemLibrarySectionModel::~ItemLibrarySectionModel() ItemLibrarySectionModel::~ItemLibrarySectionModel()
{ {
clearItems();
} }
int ItemLibrarySectionModel::rowCount(const QModelIndex &) const int ItemLibrarySectionModel::rowCount(const QModelIndex &) const
@@ -73,12 +72,6 @@ QHash<int, QByteArray> ItemLibrarySectionModel::roleNames() const
return m_roleNames; return m_roleNames;
} }
void ItemLibrarySectionModel::clearItems()
{
beginResetModel();
endResetModel();
}
void ItemLibrarySectionModel::addItem(ItemLibraryItem *element) void ItemLibrarySectionModel::addItem(ItemLibraryItem *element)
{ {
m_itemList.append(element); m_itemList.append(element);

View File

@@ -45,8 +45,6 @@ public:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QHash<int, QByteArray> roleNames() const override; QHash<int, QByteArray> roleNames() const override;
void clearItems();
void addItem(ItemLibraryItem *item); void addItem(ItemLibraryItem *item);
const QList<ItemLibraryItem *> &items() const; const QList<ItemLibraryItem *> &items() const;