aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/designer/qquickdesignersupport.cpp
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-08-09 16:41:33 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-08-18 08:42:37 +0000
commitb35858d4b8371adb030bc17f4aa161ce60e5984e (patch)
treefebe2419acf5196c27711467a7d98466e1427418 /src/quick/designer/qquickdesignersupport.cpp
parent31650bc49b64c8ee6e14094a4d869afe08c5c25d (diff)
Quick: replace 'foreach' with 'range for'
Change-Id: I3493b16a184fc811289db9e98eff37bb987113a3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/designer/qquickdesignersupport.cpp')
-rw-r--r--src/quick/designer/qquickdesignersupport.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quick/designer/qquickdesignersupport.cpp b/src/quick/designer/qquickdesignersupport.cpp
index f063cd3a81..44be12bb78 100644
--- a/src/quick/designer/qquickdesignersupport.cpp
+++ b/src/quick/designer/qquickdesignersupport.cpp
@@ -236,7 +236,8 @@ bool QQuickDesignerSupport::isAnchoredTo(QQuickItem *fromItem, QQuickItem *toIte
bool QQuickDesignerSupport::areChildrenAnchoredTo(QQuickItem *fromItem, QQuickItem *toItem)
{
- Q_FOREACH (QQuickItem *childItem, fromItem->childItems()) {
+ const auto childItems = fromItem->childItems();
+ for (QQuickItem *childItem : childItems) {
if (childItem) {
if (isAnchoredTo(childItem, toItem))
return true;
@@ -392,10 +393,10 @@ void QQuickDesignerSupport::emitComponentCompleteSignalForAttachedProperty(QQuic
QList<QObject*> QQuickDesignerSupport::statesForItem(QQuickItem *item)
{
QList<QObject*> objectList;
- QList<QQuickState *> stateList = QQuickItemPrivate::get(item)->_states()->states();
+ const QList<QQuickState *> stateList = QQuickItemPrivate::get(item)->_states()->states();
objectList.reserve(stateList.size());
- Q_FOREACH (QQuickState* state, stateList)
+ for (QQuickState* state : stateList)
objectList.append(state);
return objectList;