From 80d7ba4c49a6e1c9651695719d84e3952898f1d5 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 25 Jul 2019 14:18:09 +0300 Subject: QGradientCache: fix use of deprecated QHash::iterator::operator+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use std::next, which will transparently loop over ++it instead of calling op+, whenever the time has come to do so. Change-Id: Icee38bd96894488cf53c1596cd611c61cc68ace8 Reviewed-by: MÃ¥rten Nordheim --- src/gui/painting/qpaintengine_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 8ff77c8063..0a440e5b75 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -4295,7 +4295,7 @@ protected: QSharedPointer addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) { if (cache.size() == maxCacheSize()) { // may remove more than 1, but OK - cache.erase(cache.begin() + QRandomGenerator::global()->bounded(maxCacheSize())); + cache.erase(std::next(cache.begin(), QRandomGenerator::global()->bounded(maxCacheSize()))); } auto cache_entry = QSharedPointer::create(gradient.stops(), opacity, gradient.interpolationMode()); generateGradientColorTable(gradient, cache_entry->buffer64, paletteSize(), opacity); -- cgit v1.2.3