forked from qt-creator/qt-creator
WelcomePage: fix search filter
We reduce load on the view by using beginResetModel() and endResetModel() while filtering. Change-Id: Id3caacc78cdba1c81d915dc1cbb40ada5bfda522 Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
48a23cc28b
commit
871a25ff57
@@ -484,7 +484,12 @@ ExamplesListModelFilter::ExamplesListModelFilter(ExamplesListModel *sourceModel,
|
||||
|
||||
void ExamplesListModelFilter::updateFilter()
|
||||
{
|
||||
ExamplesListModel *exampleListModel = qobject_cast<ExamplesListModel*>(sourceModel());
|
||||
if (exampleListModel) {
|
||||
exampleListModel->beginReset();
|
||||
invalidateFilter();
|
||||
exampleListModel->endReset();
|
||||
}
|
||||
}
|
||||
|
||||
bool containsSubString(const QStringList& list, const QString& substr, Qt::CaseSensitivity cs)
|
||||
|
@@ -79,6 +79,12 @@ public:
|
||||
|
||||
void ensureInitialized() const;
|
||||
|
||||
void beginReset()
|
||||
{ beginResetModel(); }
|
||||
|
||||
void endReset()
|
||||
{ endResetModel(); }
|
||||
|
||||
signals:
|
||||
void tagsUpdated();
|
||||
|
||||
|
Reference in New Issue
Block a user