QmlDesigner: Fix "no match" visible when searching materials

... in the content library

Fixes: QDS-14996
Change-Id: Icba7b6b82a946824c593dad68e8198219cd6b1d5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Mahmoud Badri
2025-03-20 17:08:31 +02:00
committed by Tim Jenssen
parent c34beb902b
commit b3799c96d1

View File

@@ -114,22 +114,23 @@ HelperWidgets.ScrollView {
id: infoText id: infoText
text: { text: {
if (!ContentLibraryBackend.rootView.isQt6Project) if (!ContentLibraryBackend.rootView.isQt6Project) {
qsTr("<b>Content Library</b> materials are not supported in Qt5 projects.") qsTr("<b>Content Library</b> materials are not supported in Qt5 projects.")
else if (!ContentLibraryBackend.rootView.hasQuick3DImport) } else if (!ContentLibraryBackend.rootView.hasQuick3DImport) {
qsTr('To use <b>Content Library</b>, first <a href="#add_import" style="text-decoration:none;color:%1"> qsTr('To use <b>Content Library</b>, first <a href="#add_import" style="text-decoration:none;color:%1">
add the QtQuick3D module</a> in the <b>Components</b> view.') add the QtQuick3D module</a> in the <b>Components</b> view.')
.arg(StudioTheme.Values.themeInteraction) .arg(StudioTheme.Values.themeInteraction)
else if (!root.materialsModel.hasRequiredQuick3DImport) } else if (!root.materialsModel.hasRequiredQuick3DImport) {
qsTr("To use <b>Content Library</b>, version 6.3 or later of the QtQuick3D module is required.") qsTr("To use <b>Content Library</b>, version 6.3 or later of the QtQuick3D module is required.")
else if (!ContentLibraryBackend.rootView.hasMaterialLibrary) } else if (!ContentLibraryBackend.rootView.hasMaterialLibrary) {
qsTr("<b>Content Library</b> is disabled inside a non-visual component.") qsTr("<b>Content Library</b> is disabled inside a non-visual component.")
else if (!root.materialsModel.bundleExists) } else if (!root.materialsModel.bundleExists) {
qsTr("No materials available. Make sure you have an internet connection.") qsTr("No materials available. Make sure you have an internet connection.")
else if (!searchBox.isEmpty()) } else if (!searchBox.isEmpty() && root.materialsModel.isEmpty) {
qsTr("No match found.") qsTr("No match found.")
else } else {
"" ""
}
} }
textFormat: Text.RichText textFormat: Text.RichText
color: StudioTheme.Values.themeTextColor color: StudioTheme.Values.themeTextColor