QmlDesigner: Use filter on display and type names

The filter was applied just to the display names which
was confusing. We use the display and typ name with this patch.

Task-number: QTCREATORBUG-19054
Change-Id: I5671d8d615bbb89d3a46a76fd45f88d0f76c8557
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
Thomas Hartmann
2017-10-16 14:51:01 +02:00
parent 32e444d9cc
commit ef07e39c02
3 changed files with 8 additions and 1 deletions

View File

@@ -42,6 +42,11 @@ QString ItemLibraryItem::itemName() const
return m_itemLibraryEntry.name();
}
QString ItemLibraryItem::typeName() const
{
return QString::fromUtf8(m_itemLibraryEntry.typeName());
}
QString ItemLibraryItem::itemLibraryIconPath() const
{
//Prepend image provider prefix

View File

@@ -48,6 +48,7 @@ public:
~ItemLibraryItem();
QString itemName() const;
QString typeName() const;
QString itemLibraryIconPath() const;
bool setVisible(bool isVisible);

View File

@@ -75,7 +75,8 @@ bool ItemLibrarySection::updateSectionVisibility(const QString &searchText, bool
*changed = false;
foreach(ItemLibraryItem *itemLibraryItem, m_sectionEntries.items()) {
bool itemVisible = itemLibraryItem->itemName().toLower().contains(searchText);
bool itemVisible = itemLibraryItem->itemName().toLower().contains(searchText)
|| itemLibraryItem->typeName().toLower().contains(searchText);
bool itemChanged = itemLibraryItem->setVisible(itemVisible);