cleanup: replace Q_FOREACH by range-based for in profile code

With Qt-containers, this might be a small pessimization, because
it might lead to a deep copy. This can be "fixed" by
   for (const Type &item: qAsConst(container))
But frankly, I don't care. Ultimately it is probably best to
replace the Qt containers by standard containers.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2023-02-15 09:56:18 +01:00 committed by Dirk Hohndel
parent 4128fec1ea
commit 3f2e4e8b16
3 changed files with 8 additions and 11 deletions

View file

@ -689,7 +689,7 @@ void ProfileWidget2::hideEvents(DiveEventItem *item)
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
if (!empty_string(event->name)) {
hide_event(event->name);
Q_FOREACH (DiveEventItem *evItem, profileScene->eventItems) {
for (DiveEventItem *evItem: profileScene->eventItems) {
if (same_string(evItem->getEvent()->name, event->name))
evItem->hide();
}
@ -702,7 +702,7 @@ void ProfileWidget2::hideEvents(DiveEventItem *item)
void ProfileWidget2::unhideEvents()
{
show_all_events();
Q_FOREACH (DiveEventItem *item, profileScene->eventItems)
for (DiveEventItem *item: profileScene->eventItems)
item->show();
}