QtGui: port the last remaining Q_FOREACH loops and add QT_NO_FOREACH
Port the last two remaining Q_FOREACH users in QtGui to C++11 range-for and mark the library as Q_FOREACH -free, using QT_NO_FOREACH. Change-Id: Ie6c5eea0af4227af6ef3dc0b4da2cf62e09d8b52 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
f3a4b4258f
commit
8d1fc3ca4d
@ -3,7 +3,7 @@ QT = core-private
|
|||||||
|
|
||||||
qtConfig(opengl.*): MODULE_CONFIG = opengl
|
qtConfig(opengl.*): MODULE_CONFIG = opengl
|
||||||
|
|
||||||
DEFINES += QT_NO_USING_NAMESPACE
|
DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
|
||||||
|
|
||||||
QMAKE_DOCS = $$PWD/doc/qtgui.qdocconf
|
QMAKE_DOCS = $$PWD/doc/qtgui.qdocconf
|
||||||
|
|
||||||
|
@ -745,7 +745,7 @@ static void set_text(const QImage &image, png_structp png_ptr, png_infop info_pt
|
|||||||
|
|
||||||
#ifdef PNG_iTXt_SUPPORTED
|
#ifdef PNG_iTXt_SUPPORTED
|
||||||
bool needsItxt = false;
|
bool needsItxt = false;
|
||||||
foreach(const QChar c, it.value()) {
|
for (const QChar c : it.value()) {
|
||||||
uchar ch = c.cell();
|
uchar ch = c.cell();
|
||||||
if (c.row() || (ch < 0x20 && ch != '\n') || (ch > 0x7e && ch < 0xa0)) {
|
if (c.row() || (ch < 0x20 && ch != '\n') || (ch > 0x7e && ch < 0xa0)) {
|
||||||
needsItxt = true;
|
needsItxt = true;
|
||||||
|
@ -133,7 +133,7 @@ NSImage *qt_mac_create_nsimage(const QIcon &icon, int defaultSize)
|
|||||||
QList<QSize> availableSizes = icon.availableSizes();
|
QList<QSize> availableSizes = icon.availableSizes();
|
||||||
if (availableSizes.isEmpty() && defaultSize > 0)
|
if (availableSizes.isEmpty() && defaultSize > 0)
|
||||||
availableSizes << QSize(defaultSize, defaultSize);
|
availableSizes << QSize(defaultSize, defaultSize);
|
||||||
foreach (QSize size, availableSizes) {
|
for (QSize size : qAsConst(availableSizes)) {
|
||||||
QPixmap pm = icon.pixmap(size);
|
QPixmap pm = icon.pixmap(size);
|
||||||
if (pm.isNull())
|
if (pm.isNull())
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user