forked from qt-creator/qt-creator
QmlDesigner: Fix searching hidden item library categories
Task-number: QDS-4136 Change-Id: I6ba2109015914af1435a03bd7a346c0eba0a8100 Reviewed-by: Miina Puuronen <miina.puuronen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -116,9 +116,6 @@ bool ItemLibraryImport::updateCategoryVisibility(const QString &searchText, bool
|
|||||||
*changed = false;
|
*changed = false;
|
||||||
|
|
||||||
for (const auto &category : m_categoryModel.categorySections()) {
|
for (const auto &category : m_categoryModel.categorySections()) {
|
||||||
category->setCategoryVisible(ItemLibraryModel::loadCategoryVisibleState(category->categoryName()));
|
|
||||||
|
|
||||||
if (!searchText.isEmpty() || category->isCategoryVisible()) {
|
|
||||||
bool categoryChanged = false;
|
bool categoryChanged = false;
|
||||||
bool hasVisibleItems = category->updateItemVisibility(searchText, &categoryChanged);
|
bool hasVisibleItems = category->updateItemVisibility(searchText, &categoryChanged);
|
||||||
categoryChanged |= category->setVisible(hasVisibleItems);
|
categoryChanged |= category->setVisible(hasVisibleItems);
|
||||||
@@ -127,7 +124,9 @@ bool ItemLibraryImport::updateCategoryVisibility(const QString &searchText, bool
|
|||||||
|
|
||||||
if (hasVisibleItems)
|
if (hasVisibleItems)
|
||||||
hasVisibleCategories = true;
|
hasVisibleCategories = true;
|
||||||
}
|
|
||||||
|
if (searchText.isEmpty())
|
||||||
|
category->setCategoryVisible(ItemLibraryModel::loadCategoryVisibleState(category->categoryName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return hasVisibleCategories;
|
return hasVisibleCategories;
|
||||||
|
Reference in New Issue
Block a user