forked from qt-creator/qt-creator
QmlDesigner: Consider texture name in Material Browser search
Fixes: QDS-8414 Change-Id: I135827a3eb4c854908477c6189602b4f9ea9c431 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -82,8 +82,17 @@ bool MaterialBrowserTexturesModel::isVisible(int idx) const
|
|||||||
if (!isValidIndex(idx))
|
if (!isValidIndex(idx))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return m_searchText.isEmpty() || m_textureList.at(idx).variantProperty("source")
|
if (m_searchText.isEmpty())
|
||||||
.value().toString().contains(m_searchText, Qt::CaseInsensitive);
|
return true;
|
||||||
|
|
||||||
|
const ModelNode &texture = m_textureList.at(idx);
|
||||||
|
|
||||||
|
auto propertyHasMatch = [&](const PropertyName &property) -> bool {
|
||||||
|
return texture.variantProperty(property).value().toString().contains(m_searchText,
|
||||||
|
Qt::CaseInsensitive);
|
||||||
|
};
|
||||||
|
|
||||||
|
return propertyHasMatch("objectName") || propertyHasMatch("source");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MaterialBrowserTexturesModel::isValidIndex(int idx) const
|
bool MaterialBrowserTexturesModel::isValidIndex(int idx) const
|
||||||
|
|||||||
Reference in New Issue
Block a user