QMdiArea: port Q_FOREACH to ranged-for: loop doesn't change container
The container is childWindows in all cases: - place(): queries the windows' geometries - setChildActivationEnabled(): sets a bool member in subwindow->d - subWindowList(): {pre,ap}pends windows pointers to a separate QList Task-number: QTBUG-115803 Change-Id: I0fdd5f22f29f085b71bf46f68bf9ec04c45c9317 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 79dc2980e69d1b568c3c80e30a3bd0af21548f22) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
c013c57c84
commit
928885a5c0
@ -846,7 +846,7 @@ void QMdiAreaPrivate::place(Placer *placer, QMdiSubWindow *child)
|
||||
QList<QRect> rects;
|
||||
rects.reserve(childWindows.size());
|
||||
QRect parentRect = q->rect();
|
||||
foreach (QMdiSubWindow *window, childWindows) {
|
||||
for (QMdiSubWindow *window : std::as_const(childWindows)) {
|
||||
if (!sanityCheck(window, "QMdiArea::place") || window == child || !window->isVisibleTo(q)
|
||||
|| !window->testAttribute(Qt::WA_Moved)) {
|
||||
continue;
|
||||
@ -1302,7 +1302,7 @@ bool QMdiAreaPrivate::lastWindowAboutToBeDestroyed() const
|
||||
*/
|
||||
void QMdiAreaPrivate::setChildActivationEnabled(bool enable, bool onlyNextActivationEvent) const
|
||||
{
|
||||
foreach (QMdiSubWindow *subWindow, childWindows) {
|
||||
for (QMdiSubWindow *subWindow : childWindows) {
|
||||
if (!subWindow || !subWindow->isVisible())
|
||||
continue;
|
||||
if (onlyNextActivationEvent)
|
||||
@ -1340,7 +1340,7 @@ QMdiAreaPrivate::subWindowList(QMdiArea::WindowOrder order, bool reversed) const
|
||||
return list;
|
||||
|
||||
if (order == QMdiArea::CreationOrder) {
|
||||
foreach (QMdiSubWindow *child, childWindows) {
|
||||
for (QMdiSubWindow *child : childWindows) {
|
||||
if (!child)
|
||||
continue;
|
||||
if (!reversed)
|
||||
|
Loading…
x
Reference in New Issue
Block a user