Gui: modernize C++: use range-based for loop

This commit is contained in:
wmayer
2023-08-14 19:40:21 +02:00
committed by wwmayer
parent 26f16f7410
commit 2725c3a54f
42 changed files with 234 additions and 240 deletions

View File

@@ -604,8 +604,8 @@ void TaskView::updateWatcher()
void TaskView::addTaskWatcher(const std::vector<TaskWatcher*> &Watcher)
{
// remove and delete the old set of TaskWatcher
for (std::vector<TaskWatcher*>::iterator it=ActiveWatcher.begin();it!=ActiveWatcher.end();++it)
delete *it;
for (TaskWatcher* tw : ActiveWatcher)
delete tw;
ActiveWatcher = Watcher;
addTaskWatcher();
@@ -622,10 +622,10 @@ void TaskView::clearTaskWatcher()
void TaskView::addTaskWatcher()
{
// add all widgets for all watcher to the task view
for (std::vector<TaskWatcher*>::iterator it=ActiveWatcher.begin();it!=ActiveWatcher.end();++it){
std::vector<QWidget*> &cont = (*it)->getWatcherContent();
for (std::vector<QWidget*>::iterator it2=cont.begin();it2!=cont.end();++it2){
taskPanel->addWidget(*it2);
for (TaskWatcher* tw : ActiveWatcher) {
std::vector<QWidget*> &cont = tw->getWatcherContent();
for (QWidget* w : cont) {
taskPanel->addWidget(w);
}
}
@@ -668,11 +668,11 @@ void TaskView::removeTaskWatcher()
}
// remove all widgets
for (std::vector<TaskWatcher*>::iterator it=ActiveWatcher.begin();it!=ActiveWatcher.end();++it) {
std::vector<QWidget*> &cont = (*it)->getWatcherContent();
for (std::vector<QWidget*>::iterator it2=cont.begin();it2!=cont.end();++it2) {
(*it2)->hide();
taskPanel->removeWidget(*it2);
for (TaskWatcher* tw : ActiveWatcher) {
std::vector<QWidget*> &cont = tw->getWatcherContent();
for (QWidget* w : cont) {
w->hide();
taskPanel->removeWidget(w);
}
}