forked from qt-creator/qt-creator
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:
@@ -39,7 +39,6 @@ ItemLibrarySectionModel::ItemLibrarySectionModel(QObject *parent) :
|
||||
|
||||
ItemLibrarySectionModel::~ItemLibrarySectionModel()
|
||||
{
|
||||
clearItems();
|
||||
}
|
||||
|
||||
int ItemLibrarySectionModel::rowCount(const QModelIndex &) const
|
||||
@@ -73,12 +72,6 @@ QHash<int, QByteArray> ItemLibrarySectionModel::roleNames() const
|
||||
return m_roleNames;
|
||||
}
|
||||
|
||||
void ItemLibrarySectionModel::clearItems()
|
||||
{
|
||||
beginResetModel();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void ItemLibrarySectionModel::addItem(ItemLibraryItem *element)
|
||||
{
|
||||
m_itemList.append(element);
|
||||
|
@@ -45,8 +45,6 @@ public:
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
void clearItems();
|
||||
|
||||
void addItem(ItemLibraryItem *item);
|
||||
|
||||
const QList<ItemLibraryItem *> &items() const;
|
||||
|
Reference in New Issue
Block a user