summaryrefslogtreecommitdiffstats
path: root/src/tools/uic
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-05-11 11:53:02 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-05-11 16:55:32 +0000
commitf0d7080e9e640fdc7b540aba69bfbc14fc96ce39 (patch)
treee12977a9f80e2125753d94f618fcfcc38092a161 /src/tools/uic
parent81793b8b58cde01e52675093dc378147dc2102e3 (diff)
qmake/tools: port the last remaining Q_FOREACH loops and add QT_NO_FOREACH
Port the last four remaining Q_FOREACH users in qmake and uic to C++11 range-for and mark all qtbase tools (incl. qmake) as Q_FOREACH-free, using QT_NO_FOREACH. Change-Id: Ief4e5877269e7a853e4cf05e58861a448e822d3d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/tools/uic')
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp10
-rw-r--r--src/tools/uic/uic.pro2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index 026d099dc0..7466da47f3 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -770,7 +770,7 @@ void WriteInitialization::acceptWidget(DomWidget *node)
//
// Special handling for qtableview/qtreeview fake header attributes
//
- static QStringList realPropertyNames =
+ static const QStringList realPropertyNames =
(QStringList() << QLatin1String("visible")
<< QLatin1String("cascadingSectionResizes")
<< QLatin1String("defaultSectionSize")
@@ -782,7 +782,7 @@ void WriteInitialization::acceptWidget(DomWidget *node)
if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QTreeView"))
|| m_uic->customWidgetsInfo()->extends(className, QLatin1String("QTreeWidget"))) {
DomPropertyList headerProperties;
- foreach (const QString &realPropertyName, realPropertyNames) {
+ for (const QString &realPropertyName : realPropertyNames) {
const QString upperPropertyName = realPropertyName.at(0).toUpper()
+ realPropertyName.mid(1);
const QString fakePropertyName = QLatin1String("header") + upperPropertyName;
@@ -797,13 +797,13 @@ void WriteInitialization::acceptWidget(DomWidget *node)
} else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QTableView"))
|| m_uic->customWidgetsInfo()->extends(className, QLatin1String("QTableWidget"))) {
- static QStringList headerPrefixes =
+ static const QStringList headerPrefixes =
(QStringList() << QLatin1String("horizontalHeader")
<< QLatin1String("verticalHeader"));
- foreach (const QString &headerPrefix, headerPrefixes) {
+ for (const QString &headerPrefix : headerPrefixes) {
DomPropertyList headerProperties;
- foreach (const QString &realPropertyName, realPropertyNames) {
+ for (const QString &realPropertyName : realPropertyNames) {
const QString upperPropertyName = realPropertyName.at(0).toUpper()
+ realPropertyName.mid(1);
const QString fakePropertyName = headerPrefix + upperPropertyName;
diff --git a/src/tools/uic/uic.pro b/src/tools/uic/uic.pro
index a625bdef9a..8008dde07a 100644
--- a/src/tools/uic/uic.pro
+++ b/src/tools/uic/uic.pro
@@ -1,6 +1,6 @@
option(host_build)
-DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII
+DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
include(uic.pri)
include(cpp/cpp.pri)