diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-08-09 16:41:33 +0300 |
---|---|---|
committer | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-08-18 08:42:37 +0000 |
commit | b35858d4b8371adb030bc17f4aa161ce60e5984e (patch) | |
tree | febe2419acf5196c27711467a7d98466e1427418 /src/quick/util/qquickpath.cpp | |
parent | 31650bc49b64c8ee6e14094a4d869afe08c5c25d (diff) |
Quick: replace 'foreach' with 'range for'
Change-Id: I3493b16a184fc811289db9e98eff37bb987113a3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/util/qquickpath.cpp')
-rw-r--r-- | src/quick/util/qquickpath.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp index dfed4c1885..25a4433a9b 100644 --- a/src/quick/util/qquickpath.cpp +++ b/src/quick/util/qquickpath.cpp @@ -358,7 +358,7 @@ QPainterPath QQuickPath::createPath(const QPointF &startPoint, const QPointF &en bool usesPercent = false; int index = 0; - foreach (QQuickPathElement *pathElement, d->_pathElements) { + for (QQuickPathElement *pathElement : qAsConst(d->_pathElements)) { if (QQuickCurve *curve = qobject_cast<QQuickCurve *>(pathElement)) { QQuickPathData data; data.index = index; @@ -432,17 +432,17 @@ void QQuickPath::classBegin() void QQuickPath::disconnectPathElements() { - Q_D(QQuickPath); + Q_D(const QQuickPath); - foreach (QQuickPathElement *pathElement, d->_pathElements) + for (QQuickPathElement *pathElement : d->_pathElements) disconnect(pathElement, SIGNAL(changed()), this, SLOT(processPath())); } void QQuickPath::connectPathElements() { - Q_D(QQuickPath); + Q_D(const QQuickPath); - foreach (QQuickPathElement *pathElement, d->_pathElements) + for (QQuickPathElement *pathElement : d->_pathElements) connect(pathElement, SIGNAL(changed()), this, SLOT(processPath())); } @@ -453,7 +453,7 @@ void QQuickPath::gatherAttributes() QSet<QString> attributes; // First gather up all the attributes - foreach (QQuickPathElement *pathElement, d->_pathElements) { + for (QQuickPathElement *pathElement : qAsConst(d->_pathElements)) { if (QQuickCurve *curve = qobject_cast<QQuickCurve *>(pathElement)) d->_pathCurves.append(curve); else if (QQuickPathAttribute *attribute = qobject_cast<QQuickPathAttribute *>(pathElement)) @@ -488,7 +488,7 @@ QStringList QQuickPath::attributes() const QSet<QString> attrs; // First gather up all the attributes - foreach (QQuickPathElement *pathElement, d->_pathElements) { + for (QQuickPathElement *pathElement : d->_pathElements) { if (QQuickPathAttribute *attribute = qobject_cast<QQuickPathAttribute *>(pathElement)) attrs.insert(attribute->name()); |