diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2022-11-30 17:14:22 +0200 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2022-11-30 19:12:47 +0000 |
commit | 072bdb22fc5b3e9c0f61d84175930a361f1cf8fd (patch) | |
tree | bf85872645b9d21dff1532f9f0d2b39b0b114727 | |
parent | 714c3c381e16e6763e3984f6e66b274b75ecb42b (diff) | |
download | qt-creator-072bdb22fc5b3e9c0f61d84175930a361f1cf8fd.tar.gz |
QmlDesigner: Update isEmpty state upon content library load
Change-Id: Ibb26294efac90e177f5e4f691609a95f6a181475
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
-rw-r--r-- | src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp | 5 | ||||
-rw-r--r-- | src/plugins/qmldesigner/components/contentlibrary/contentlibrarytexturesmodel.cpp | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp index 92be78f016..55acaf1574 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp @@ -162,6 +162,11 @@ void ContentLibraryMaterialsModel::loadMaterialBundle() emit importerRunningChanged(); emit bundleMaterialUnimported(metaInfo); }); + + if (m_bundleCategories.isEmpty() != m_isEmpty) { + m_isEmpty = m_bundleCategories.isEmpty(); + emit isEmptyChanged(); + } } bool ContentLibraryMaterialsModel::hasQuick3DImport() const diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarytexturesmodel.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarytexturesmodel.cpp index 4d793e4e2b..8a0ea67c3e 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarytexturesmodel.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarytexturesmodel.cpp @@ -85,6 +85,11 @@ void ContentLibraryTexturesModel::loadTextureBundle(const QString &bundlePath) category->addTexture(tex); m_bundleCategories.append(category); } + + if (m_bundleCategories.isEmpty() != m_isEmpty) { + m_isEmpty = m_bundleCategories.isEmpty(); + emit isEmptyChanged(); + } } bool ContentLibraryTexturesModel::hasQuick3DImport() const |