summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmainwindowlayout.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-02-27 02:56:31 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-02-28 10:50:08 +0000
commite1c2bfa53b7549a1283f5b52974ea90b6a2b4659 (patch)
treeed288bdc68ec3e66bc08fc6fd0e337cb5d7d74d8 /src/widgets/widgets/qmainwindowlayout.cpp
parent1d8030cc64df2cdfdc0faf3d06ea7d9ed0306948 (diff)
QtWidgets: eradicate Q_FOREACH loops [QVarLengthArray, std containers]
Q_FOREACH over a QVarLengthArray or std containers is a particularly bad idea (because of the deep copy that Q_FOREACH then performs). Use C++11 range-for (without qAsConst(), because neither QVLA nor std containers are CoW). Saves 5.7KiB in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I4c1fb0b488bb08726912528b559840a45c1397df Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/widgets/qmainwindowlayout.cpp')
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index e46063917d..63a6c718bc 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -2386,7 +2386,7 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
}
}
}
- foreach (QWidget *w, candidates) {
+ for (QWidget *w : candidates) {
QWindow *handle1 = widget->windowHandle();
QWindow *handle2 = w->windowHandle();
if (handle1 && handle2 && handle1->screen() != handle2->screen())