From ab2f933fdf5f2d5e8a697d7916c080245f57c0e9 Mon Sep 17 00:00:00 2001 From: joshua Date: Wed, 28 Jan 2026 19:47:04 +0100 Subject: [PATCH] Re-enable multi-threading to load collection The name of the elements and folders of the collection are not displayed until we hover the item with the mouse. This due that QtConcurent::run was disabled at loading of collection in the goal of use QtConcurrent::run with Qt6. Run is made to run a function once. Map is made to run a fonction for each item of a sequence (what we need in this case). Remove code of run and re-enable code for map. --- .../ElementsCollection/elementscollectionmodel.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/sources/ElementsCollection/elementscollectionmodel.cpp b/sources/ElementsCollection/elementscollectionmodel.cpp index 2663c008f..179d3530f 100644 --- a/sources/ElementsCollection/elementscollectionmodel.cpp +++ b/sources/ElementsCollection/elementscollectionmodel.cpp @@ -26,12 +26,7 @@ #include "xmlprojectelementcollectionitem.h" #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove #include -#else -#include -#endif - /** @brief ElementsCollectionModel::ElementsCollectionModel Constructor @@ -298,15 +293,8 @@ void ElementsCollectionModel::loadCollections(bool common_collection, &QFutureWatcher::finished, watcher, &QFutureWatcher::deleteLater); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove + m_future = QtConcurrent::map(m_items_list_to_setUp, setUpData); -#else -# if TODO_LIST -# pragma message("@TODO remove code for QT 6 or later") -# endif - qDebug() << "Help code for QT 6 or later" - << "QtConcurrent::run its backwards now...function, object, args"; -#endif watcher->setFuture(m_future); }