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 4991475341
commit e09d8aaba6
42 changed files with 234 additions and 240 deletions

View File

@@ -429,8 +429,8 @@ void Polyline::paintGL()
if (closed && !stippled) {
glBegin(GL_LINE_LOOP);
for (std::vector<QPoint>::iterator it = _cNodeVector.begin(); it != _cNodeVector.end(); ++it) {
glVertex2i(it->x(), it->y());
for (const QPoint& it : _cNodeVector) {
glVertex2i(it.x(), it.y());
}
glEnd();
@@ -439,10 +439,10 @@ void Polyline::paintGL()
glBegin(GL_LINES);
QPoint start = _cNodeVector.front();
for (std::vector<QPoint>::iterator it = _cNodeVector.begin(); it != _cNodeVector.end(); ++it) {
for (const QPoint& it : _cNodeVector) {
glVertex2i(start.x(), start.y());
start = *it;
glVertex2i(it->x(), it->y());
start = it;
glVertex2i(it.x(), it.y());
}
glEnd();