summaryrefslogtreecommitdiff
path: root/src/shared/qtgradienteditor/qtgradientstopsmodel.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2023-03-23 16:00:31 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2023-03-23 16:00:31 +0200
commit1e7d50937f4b94c37a16f6370c0fd4ccb4329190 (patch)
tree94b5752f1ae4372db08848e3020295c1de567686 /src/shared/qtgradienteditor/qtgradientstopsmodel.cpp
parent6914f7c8039e5d9aab9446a6d0d882caf9f61025 (diff)
parent55fe27c4455eb54830bb08f19e34d8f2f137ad2f (diff)
downloadqttools-5.15.tar.gz
Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into tqtc/lts-5.15-opensourcev5.15.9-lts-lgpl5.15
Change-Id: I2813471aad9bc8b9bd04efe8571be6d1bee3045c
Diffstat (limited to 'src/shared/qtgradienteditor/qtgradientstopsmodel.cpp')
-rw-r--r--src/shared/qtgradienteditor/qtgradientstopsmodel.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/shared/qtgradienteditor/qtgradientstopsmodel.cpp b/src/shared/qtgradienteditor/qtgradientstopsmodel.cpp
index 0afbf49bb..2422926c4 100644
--- a/src/shared/qtgradienteditor/qtgradientstopsmodel.cpp
+++ b/src/shared/qtgradienteditor/qtgradientstopsmodel.cpp
@@ -418,17 +418,12 @@ void QtGradientStopsModel::clearSelection()
selectStop(stop, false);
}
-namespace {
- template <typename BidirectionalIterator>
- std::reverse_iterator<BidirectionalIterator> rev(BidirectionalIterator it)
- { return std::reverse_iterator<BidirectionalIterator>(it); }
-}
-
void QtGradientStopsModel::flipAll()
{
QMap<qreal, QtGradientStop *> stopsMap = stops();
QMap<QtGradientStop *, bool> swappedList;
- for (auto itStop = rev(stopsMap.keyValueEnd()), end = rev(stopsMap.keyValueBegin()); itStop != end; ++itStop) {
+ for (auto itStop = stopsMap.keyValueEnd(), begin = stopsMap.keyValueBegin(); itStop != begin;) {
+ --itStop;
QtGradientStop *stop = (*itStop).second;
if (swappedList.contains(stop))
continue;