summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengine_raster.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-07-25 14:18:09 +0300
committerMarc Mutz <marc.mutz@kdab.com>2019-07-28 12:21:55 +0300
commit80d7ba4c49a6e1c9651695719d84e3952898f1d5 (patch)
tree16927f26ad269a050c1ddaf7a3917e1a584e0e25 /src/gui/painting/qpaintengine_raster.cpp
parent82d24b43883732ae0cff1f52ea4ecae9dd734c73 (diff)
QGradientCache: fix use of deprecated QHash::iterator::operator+
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 <marten.nordheim@qt.io>
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp2
1 files changed, 1 insertions, 1 deletions
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<const CacheInfo> 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<CacheInfo>::create(gradient.stops(), opacity, gradient.interpolationMode());
generateGradientColorTable(gradient, cache_entry->buffer64, paletteSize(), opacity);