diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 5f8cbe2cbe..511cfd1d22 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -3,7 +3,7 @@ QT = core-private qtConfig(opengl.*): MODULE_CONFIG = opengl -DEFINES += QT_NO_USING_NAMESPACE +DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH QMAKE_DOCS = $$PWD/doc/qtgui.qdocconf diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index d55a26b2a4..1d19c165fc 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -745,7 +745,7 @@ static void set_text(const QImage &image, png_structp png_ptr, png_infop info_pt #ifdef PNG_iTXt_SUPPORTED bool needsItxt = false; - foreach(const QChar c, it.value()) { + for (const QChar c : it.value()) { uchar ch = c.cell(); if (c.row() || (ch < 0x20 && ch != '\n') || (ch > 0x7e && ch < 0xa0)) { needsItxt = true; diff --git a/src/gui/painting/qcoregraphics.mm b/src/gui/painting/qcoregraphics.mm index a64a184e25..768d3e7148 100644 --- a/src/gui/painting/qcoregraphics.mm +++ b/src/gui/painting/qcoregraphics.mm @@ -133,7 +133,7 @@ NSImage *qt_mac_create_nsimage(const QIcon &icon, int defaultSize) QList availableSizes = icon.availableSizes(); if (availableSizes.isEmpty() && defaultSize > 0) availableSizes << QSize(defaultSize, defaultSize); - foreach (QSize size, availableSizes) { + for (QSize size : qAsConst(availableSizes)) { QPixmap pm = icon.pixmap(size); if (pm.isNull()) continue;