Browse Source

UI: Use C++11 ranged-for instead of Q_FOREACH

Qt has been porting uses of Q_FOREACH/foreach to C++11's ranged-for.
Let's do the same.

References:
 * https://doc.qt.io/qt-6/foreach-keyword.html
 * https://codereview.qt-project.org/q/Q_FOREACH
Ryan Foster 2 years ago
parent
commit
3d05d681b7
1 changed files with 4 additions and 2 deletions
  1. 4 2
      UI/window-basic-main.cpp

+ 4 - 2
UI/window-basic-main.cpp

@@ -10882,9 +10882,11 @@ void OBSBasic::CheckDiskSpaceRemaining()
 
 void OBSBasic::ResetStatsHotkey()
 {
-	QList<OBSBasicStats *> list = findChildren<OBSBasicStats *>();
+	const QList<OBSBasicStats *> list = findChildren<OBSBasicStats *>();
 
-	foreach(OBSBasicStats * s, list) s->Reset();
+	for (OBSBasicStats *s : list) {
+		s->Reset();
+	}
 }
 
 void OBSBasic::on_OBSBasic_customContextMenuRequested(const QPoint &pos)