summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels/qitemselectionmodel.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-05-18 14:49:04 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-12-05 00:47:44 +0100
commit105a66e6543467863a39cd12271f125b45d74179 (patch)
tree3362c298e5e930b6a7791584fe065aa0f8bd8a57 /src/corelib/itemmodels/qitemselectionmodel.cpp
parentf19266bd02a01d4b7b277ea769c4c17727b1e661 (diff)
Use (new) erase()/erase_if() algorithms
Change-Id: I45c18fd45c20b226e44d16315e3ebb6c305d4ab0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/itemmodels/qitemselectionmodel.cpp')
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index b6a6bff118..b12cfc471b 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -1252,9 +1252,7 @@ void QItemSelectionModel::select(const QItemSelection &selection, QItemSelection
// be too late if another model observer is connected to the same modelReset slot and is invoked first
// it might call select() on this selection model before any such QItemSelectionModelPrivate::_q_modelReset() slot
// is invoked, so it would not be cleared yet. We clear it invalid ranges in it here.
- using namespace QtFunctionObjects;
- d->ranges.erase(std::remove_if(d->ranges.begin(), d->ranges.end(), IsNotValid()),
- d->ranges.end());
+ d->ranges.removeIf(QtFunctionObjects::IsNotValid());
QItemSelection old = d->ranges;
old.merge(d->currentSelection, d->currentCommand);
@@ -1755,10 +1753,7 @@ const QItemSelection QItemSelectionModel::selection() const
selected.merge(d->currentSelection, d->currentCommand);
// make sure we have no invalid ranges
// ### should probably be handled more generic somewhere else
- using namespace QtFunctionObjects;
- selected.erase(std::remove_if(selected.begin(), selected.end(),
- IsNotValid()),
- selected.end());
+ selected.removeIf(QtFunctionObjects::IsNotValid());
return selected;
}