From 8b0cece0ba8033c5dcb014fd72099678dd9c65d3 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Wed, 25 Mar 2020 19:30:08 +0100 Subject: [PATCH] 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 --- .../components/itemlibrary/itemlibrarysectionmodel.cpp | 7 ------- .../components/itemlibrary/itemlibrarysectionmodel.h | 2 -- 2 files changed, 9 deletions(-) diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.cpp index c18a486fda8..5a60dd1eb78 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.cpp @@ -39,7 +39,6 @@ ItemLibrarySectionModel::ItemLibrarySectionModel(QObject *parent) : ItemLibrarySectionModel::~ItemLibrarySectionModel() { - clearItems(); } int ItemLibrarySectionModel::rowCount(const QModelIndex &) const @@ -73,12 +72,6 @@ QHash ItemLibrarySectionModel::roleNames() const return m_roleNames; } -void ItemLibrarySectionModel::clearItems() -{ - beginResetModel(); - endResetModel(); -} - void ItemLibrarySectionModel::addItem(ItemLibraryItem *element) { m_itemList.append(element); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h index 6d543b5afae..6e1771a52f0 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h @@ -45,8 +45,6 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QHash roleNames() const override; - void clearItems(); - void addItem(ItemLibraryItem *item); const QList &items() const;