forked from qt-creator/qt-creator
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:
@@ -42,6 +42,11 @@ QString ItemLibraryItem::itemName() const
|
|||||||
return m_itemLibraryEntry.name();
|
return m_itemLibraryEntry.name();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ItemLibraryItem::typeName() const
|
||||||
|
{
|
||||||
|
return QString::fromUtf8(m_itemLibraryEntry.typeName());
|
||||||
|
}
|
||||||
|
|
||||||
QString ItemLibraryItem::itemLibraryIconPath() const
|
QString ItemLibraryItem::itemLibraryIconPath() const
|
||||||
{
|
{
|
||||||
//Prepend image provider prefix
|
//Prepend image provider prefix
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public:
|
|||||||
~ItemLibraryItem();
|
~ItemLibraryItem();
|
||||||
|
|
||||||
QString itemName() const;
|
QString itemName() const;
|
||||||
|
QString typeName() const;
|
||||||
QString itemLibraryIconPath() const;
|
QString itemLibraryIconPath() const;
|
||||||
|
|
||||||
bool setVisible(bool isVisible);
|
bool setVisible(bool isVisible);
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ bool ItemLibrarySection::updateSectionVisibility(const QString &searchText, bool
|
|||||||
*changed = false;
|
*changed = false;
|
||||||
|
|
||||||
foreach(ItemLibraryItem *itemLibraryItem, m_sectionEntries.items()) {
|
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);
|
bool itemChanged = itemLibraryItem->setVisible(itemVisible);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user