From a1ee5b58b99826b0b091028ea6be4ed36ddbcea8 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Thu, 25 Jan 2024 19:23:37 +0100 Subject: [PATCH] changed QList to std::vector (as QList::emplaceBack ist not available in all Qt versions --- lib/jkqtcommon/jkqtpcachingtools.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/jkqtcommon/jkqtpcachingtools.h b/lib/jkqtcommon/jkqtpcachingtools.h index f9fbd1b39c..5295b244cc 100644 --- a/lib/jkqtcommon/jkqtpcachingtools.h +++ b/lib/jkqtcommon/jkqtpcachingtools.h @@ -34,6 +34,7 @@ #include #include #include +#include #include /** \brief tag type to configure JKQTPDataCache for thread-safety @@ -169,10 +170,10 @@ private: inline void cleanCache_notThreadSafe() { if (m_maxEntries<0 || m_cache.size()(m_maxEntries)) return; const int deleteItems=jkqtp_boundedRoundTo(1, (1.0-m_retainFraction)*static_cast(m_cache.size()), m_cache.size()); - QList > allItems; + std::vector > allItems; allItems.reserve(m_cacheLastUseTimestamps.size()); for (auto it=m_cacheLastUseTimestamps.begin(); it!=m_cacheLastUseTimestamps.end(); ++it) { - allItems.emplaceBack(it->first, it->second->load()); + allItems.emplace_back(it->first, it->second->load()); } std::sort(allItems.begin(), allItems.end(), [](const QPair&a, const QPair&b) {return a.second>b.second;}); for (int i=0; i