diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2023-10-30 18:52:24 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2023-10-31 11:39:03 +0000 |
commit | bc250d9cf0e541a2fad77446d9631b4d295f9b76 (patch) | |
tree | acee9d08c301f7abffbcae205239b8cd7a070069 /src/plugins/qtsupport/exampleslistmodel.cpp | |
parent | 8762af4912ac54e4efa5b30b6695a3bd448586e1 (diff) |
QtSupport: Don't show semi laid out examples while updating
This hides the examples SectionedGridView while the examples.xml files
are loaded. When shown, they are directly in the full size.
An additional benefit lies in the initial loading of less thumbnail
images because with QTCREATORBUG-29811, many more thumbnails were
visible in the initial view than now.
Fixes: QTCREATORBUG-29811
Change-Id: I42f362497859b0b98dc48ef0f1b6399d91c0db28
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/qtsupport/exampleslistmodel.cpp')
-rw-r--r-- | src/plugins/qtsupport/exampleslistmodel.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 2a48449ef3..3d67706b77 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -364,8 +364,6 @@ void ExamplesViewController::updateExamples() const QStringList sources = m_exampleSetModel->exampleSources(&examplesInstallPath, &demosInstallPath, &qtVersion); - m_view->clear(); - QStringList categoryOrder; QList<ExampleItem *> items; for (const QString &exampleSource : sources) { @@ -404,12 +402,18 @@ void ExamplesViewController::updateExamples() : categoryOrder; const QList<std::pair<Section, QList<ExampleItem *>>> sections = getCategories(items, sortIntoCategories, order, m_isExamples); + + m_view->setVisible(false); + m_view->clear(); + for (int i = 0; i < sections.size(); ++i) { m_view->addSection(sections.at(i).first, static_container_cast<ListItem *>(sections.at(i).second)); } if (!m_searchField->text().isEmpty()) m_view->setSearchString(m_searchField->text()); + + m_view->setVisible(true); } void ExamplesViewController::setVisible(bool visible) |