forked from qt-creator/qt-creator
QmlDesigner: Remove foreach / Q_FOREACH usage in designercore
Task-number: QTCREATORBUG-27464 Change-Id: Ib1e693df7e3690b7cf3e6dc42e1d18a05a8f46d6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -40,7 +40,8 @@ FirstDefinitionFinder::FirstDefinitionFinder(const QString &text):
|
||||
|
||||
if (!ok) {
|
||||
qDebug() << text;
|
||||
foreach (const QmlJS::DiagnosticMessage &message, m_doc->diagnosticMessages())
|
||||
const QList<QmlJS::DiagnosticMessage> messages = m_doc->diagnosticMessages();
|
||||
for (const QmlJS::DiagnosticMessage &message : messages)
|
||||
qDebug() << message.message;
|
||||
}
|
||||
|
||||
|
@@ -92,14 +92,14 @@ template <class ViewType>
|
||||
void ForwardView<ViewType>::modelAttached(Model *model)
|
||||
{
|
||||
AbstractView::modelAttached(model);
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->modelAttached(model);
|
||||
}
|
||||
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::modelAboutToBeDetached(Model *model)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->modelAboutToBeDetached(model);
|
||||
|
||||
AbstractView::modelAboutToBeDetached(model);
|
||||
@@ -108,35 +108,35 @@ void ForwardView<ViewType>::modelAboutToBeDetached(Model *model)
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::nodeCreated(const ModelNode &createdNode)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->nodeCreated(ModelNode(createdNode, view.data()));
|
||||
}
|
||||
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::nodeAboutToBeRemoved(const ModelNode &removedNode)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->nodeAboutToBeRemoved(ModelNode(removedNode, view.data()));
|
||||
}
|
||||
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::nodeRemoved(const ModelNode &removedNode, const NodeAbstractProperty &parentProperty, PropertyChangeFlags propertyChange)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->nodeRemoved(ModelNode(removedNode, view.data()), NodeAbstractProperty(parentProperty, view.data()), propertyChange);
|
||||
}
|
||||
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::nodeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty &oldPropertyParent, PropertyChangeFlags propertyChange)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->nodeReparented(ModelNode(node, view.data()), NodeAbstractProperty(newPropertyParent, view.data()), NodeAbstractProperty(oldPropertyParent, view.data()), propertyChange);
|
||||
}
|
||||
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->nodeIdChanged(ModelNode(node, view.data()), newId, oldId);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ static QList<T> adjustedList(const QList<T>& oldList, AbstractView *view)
|
||||
{
|
||||
QList<T> newList;
|
||||
|
||||
foreach (const T &item, oldList)
|
||||
for (const T &item : oldList)
|
||||
{
|
||||
newList.append(T(item, view));
|
||||
}
|
||||
@@ -156,41 +156,41 @@ static QList<T> adjustedList(const QList<T>& oldList, AbstractView *view)
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::propertiesAboutToBeRemoved(const QList<AbstractProperty>& propertyList)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->propertiesAboutToBeRemoved(adjustedList(propertyList, view.data()));
|
||||
}
|
||||
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::propertiesRemoved(const QList<AbstractProperty>& propertyList)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->propertiesRemoved(adjustedList(propertyList, view.data()));
|
||||
}
|
||||
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::variantPropertiesChanged(const QList<VariantProperty>& propertyList, PropertyChangeFlags propertyChange)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->variantPropertiesChanged(adjustedList(propertyList, view.data()), propertyChange);
|
||||
}
|
||||
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::bindingPropertiesChanged(const QList<BindingProperty>& propertyList, PropertyChangeFlags propertyChange)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->bindingPropertiesChanged(adjustedList(propertyList, view.data()), propertyChange);
|
||||
}
|
||||
|
||||
void ForwardView::signalHandlerPropertiesChanged(const QVector<SignalHandlerProperty> &propertyList, AbstractView::PropertyChangeFlags propertyChange)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->signalHandlerPropertiesChanged(adjustedList(propertyList, view.data()), propertyChange);
|
||||
}
|
||||
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->rootNodeTypeChanged(type, majorVersion, minorVersion);
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ template <class ViewType>
|
||||
void ForwardView<ViewType>::selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
|
||||
const QList<ModelNode> &lastSelectedNodeList)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->selectedNodesChanged(adjustedList(selectedNodeList, view.data()), adjustedList(lastSelectedNodeList, view.data()));
|
||||
}
|
||||
|
||||
@@ -207,21 +207,21 @@ void ForwardView<ViewType>::fileUrlChanged(const QUrl &oldUrl, const QUrl &newUr
|
||||
{
|
||||
AbstractView::fileUrlChanged(oldUrl, newUrl);
|
||||
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->fileUrlChanged(oldUrl, newUrl);
|
||||
}
|
||||
|
||||
template<class ViewType>
|
||||
void ForwardView<ViewType>::nodeOrderChanged(const NodeListProperty &listProperty)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->nodeOrderChanged(NodeListProperty(listProperty, view.data()));
|
||||
}
|
||||
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::importChanged(const QList<Import> &addedImports, const QList<Import> &removedImports)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->importChanged(addedImport, removedImport);
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ void ForwardView<ViewType>::importRemoved(const Import &import)
|
||||
{
|
||||
AbstractView::importRemoved(import);
|
||||
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->importRemoved(import);
|
||||
}
|
||||
|
||||
@@ -239,14 +239,14 @@ void ForwardView<ViewType>::auxiliaryDataChanged(const ModelNode &node, const Pr
|
||||
{
|
||||
AbstractView::auxiliaryDataChanged(node, name, data);
|
||||
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->auxiliaryDataChanged(ModelNode(node, view.data()), name, data);
|
||||
}
|
||||
|
||||
template <class ViewType>
|
||||
void ForwardView<ViewType>::scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList)
|
||||
{
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
view->scriptFunctionsChanged(node, scriptFunctionList);
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ QList<ViewType*> ForwardView<ViewType>::viewList() const
|
||||
{
|
||||
QList<ViewType*> newList;
|
||||
|
||||
foreach (const ViewTypePointer &view, m_targetViewList)
|
||||
for (const ViewTypePointer &view : qAsConst(m_targetViewList))
|
||||
newList.append(view.data());
|
||||
|
||||
return newList;
|
||||
|
@@ -174,7 +174,8 @@ QString NodeInstanceServerProxy::qrcMappingString() const
|
||||
|
||||
using StringPair = QPair<QString, QString>;
|
||||
|
||||
foreach (const StringPair &pair, rewriterView->qrcMapping()) {
|
||||
const QSet<QPair<QString, QString>> &pairs = rewriterView->qrcMapping();
|
||||
for (const StringPair &pair : pairs) {
|
||||
if (!mappingString.isEmpty())
|
||||
mappingString.append(QLatin1String(";"));
|
||||
mappingString.append(pair.first);
|
||||
|
@@ -482,7 +482,7 @@ void NodeInstanceView::propertiesAboutToBeRemoved(const QList<AbstractProperty>&
|
||||
QList<ModelNode> nodeList;
|
||||
QList<AbstractProperty> nonNodePropertyList;
|
||||
|
||||
foreach (const AbstractProperty &property, propertyList) {
|
||||
for (const AbstractProperty &property : propertyList) {
|
||||
if (property.isNodeAbstractProperty())
|
||||
nodeList.append(property.toNodeAbstractProperty().allSubNodes());
|
||||
else
|
||||
@@ -497,7 +497,7 @@ void NodeInstanceView::propertiesAboutToBeRemoved(const QList<AbstractProperty>&
|
||||
m_nodeInstanceServer->removeSharedMemory(createRemoveSharedMemoryCommand("Image", nodeList));
|
||||
m_nodeInstanceServer->removeProperties(createRemovePropertiesCommand(nonNodePropertyList));
|
||||
|
||||
foreach (const AbstractProperty &property, propertyList) {
|
||||
for (const AbstractProperty &property : propertyList) {
|
||||
const PropertyName &name = property.name();
|
||||
if (name == "anchors.fill") {
|
||||
resetHorizontalAnchors(property.parentModelNode());
|
||||
@@ -525,13 +525,14 @@ void NodeInstanceView::propertiesAboutToBeRemoved(const QList<AbstractProperty>&
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const ModelNode &node, nodeList)
|
||||
for (const ModelNode &node : qAsConst(nodeList))
|
||||
removeInstanceNodeRelationship(node);
|
||||
}
|
||||
|
||||
void NodeInstanceView::removeInstanceAndSubInstances(const ModelNode &node)
|
||||
{
|
||||
foreach (const ModelNode &subNode, node.allSubModelNodes()) {
|
||||
const QList<ModelNode> subNodes = node.allSubModelNodes();
|
||||
for (const ModelNode &subNode : subNodes) {
|
||||
if (hasInstanceForModelNode(subNode))
|
||||
removeInstanceNodeRelationship(subNode);
|
||||
}
|
||||
@@ -636,7 +637,8 @@ void NodeInstanceView::nodeOrderChanged(const NodeListProperty &listProperty)
|
||||
if (hasInstanceForModelNode(containerNode))
|
||||
containerInstanceId = instanceForModelNode(containerNode).instanceId();
|
||||
|
||||
foreach (const ModelNode &node, listProperty.toModelNodeList()) {
|
||||
const QList<ModelNode> nodes = listProperty.toModelNodeList();
|
||||
for (const ModelNode &node : nodes) {
|
||||
qint32 instanceId = -1;
|
||||
if (hasInstanceForModelNode(node)) {
|
||||
instanceId = instanceForModelNode(node).instanceId();
|
||||
@@ -848,11 +850,11 @@ NodeInstance NodeInstanceView::activeStateInstance() const
|
||||
|
||||
void NodeInstanceView::updateChildren(const NodeAbstractProperty &newPropertyParent)
|
||||
{
|
||||
QVector<ModelNode> childNodeVector = newPropertyParent.directSubNodes().toVector();
|
||||
const QVector<ModelNode> childNodeVector = newPropertyParent.directSubNodes().toVector();
|
||||
|
||||
qint32 parentInstanceId = newPropertyParent.parentModelNode().internalId();
|
||||
|
||||
foreach (const ModelNode &childNode, childNodeVector) {
|
||||
for (const ModelNode &childNode : childNodeVector) {
|
||||
qint32 instanceId = childNode.internalId();
|
||||
if (hasInstanceForId(instanceId)) {
|
||||
NodeInstance instance = instanceForId(instanceId);
|
||||
@@ -882,7 +884,7 @@ void NodeInstanceView::updatePosition(const QList<VariantProperty> &propertyList
|
||||
{
|
||||
QMultiHash<ModelNode, InformationName> informationChangeHash;
|
||||
|
||||
foreach (const VariantProperty &variantProperty, propertyList) {
|
||||
for (const VariantProperty &variantProperty : propertyList) {
|
||||
if (variantProperty.name() == "x") {
|
||||
const ModelNode modelNode = variantProperty.parentModelNode();
|
||||
if (!currentState().isBaseState() && QmlPropertyChanges::isValidQmlPropertyChanges(modelNode)) {
|
||||
@@ -957,7 +959,8 @@ void NodeInstanceView::removeRecursiveChildRelationship(const ModelNode &removed
|
||||
// instanceForNode(removedNode).setId(QString());
|
||||
// }
|
||||
|
||||
foreach (const ModelNode &childNode, removedNode.directSubModelNodes())
|
||||
const QList<ModelNode> nodes = removedNode.directSubModelNodes();
|
||||
for (const ModelNode &childNode : nodes)
|
||||
removeRecursiveChildRelationship(childNode);
|
||||
|
||||
removeInstanceNodeRelationship(removedNode);
|
||||
@@ -974,7 +977,7 @@ QRectF NodeInstanceView::sceneRect() const
|
||||
QList<ModelNode> filterNodesForSkipItems(const QList<ModelNode> &nodeList)
|
||||
{
|
||||
QList<ModelNode> filteredNodeList;
|
||||
foreach (const ModelNode &node, nodeList) {
|
||||
for (const ModelNode &node : nodeList) {
|
||||
if (isSkippedNode(node))
|
||||
continue;
|
||||
|
||||
@@ -1169,7 +1172,7 @@ ClearSceneCommand NodeInstanceView::createClearSceneCommand() const
|
||||
CompleteComponentCommand NodeInstanceView::createComponentCompleteCommand(const QList<NodeInstance> &instanceList) const
|
||||
{
|
||||
QVector<qint32> containerList;
|
||||
foreach (const NodeInstance &instance, instanceList) {
|
||||
for (const NodeInstance &instance : instanceList) {
|
||||
if (instance.instanceId() >= 0)
|
||||
containerList.append(instance.instanceId());
|
||||
}
|
||||
@@ -1180,7 +1183,7 @@ CompleteComponentCommand NodeInstanceView::createComponentCompleteCommand(const
|
||||
ComponentCompletedCommand NodeInstanceView::createComponentCompletedCommand(const QList<NodeInstance> &instanceList) const
|
||||
{
|
||||
QVector<qint32> containerList;
|
||||
foreach (const NodeInstance &instance, instanceList) {
|
||||
for (const NodeInstance &instance : instanceList) {
|
||||
if (instance.instanceId() >= 0)
|
||||
containerList.append(instance.instanceId());
|
||||
}
|
||||
@@ -1191,7 +1194,7 @@ ComponentCompletedCommand NodeInstanceView::createComponentCompletedCommand(cons
|
||||
CreateInstancesCommand NodeInstanceView::createCreateInstancesCommand(const QList<NodeInstance> &instanceList) const
|
||||
{
|
||||
QVector<InstanceContainer> containerList;
|
||||
foreach (const NodeInstance &instance, instanceList) {
|
||||
for (const NodeInstance &instance : instanceList) {
|
||||
InstanceContainer::NodeSourceType nodeSourceType = static_cast<InstanceContainer::NodeSourceType>(instance.modelNode().nodeSourceType());
|
||||
|
||||
InstanceContainer::NodeMetaType nodeMetaType = InstanceContainer::ObjectMetaType;
|
||||
@@ -1221,7 +1224,7 @@ CreateInstancesCommand NodeInstanceView::createCreateInstancesCommand(const QLis
|
||||
ReparentInstancesCommand NodeInstanceView::createReparentInstancesCommand(const QList<NodeInstance> &instanceList) const
|
||||
{
|
||||
QVector<ReparentContainer> containerList;
|
||||
foreach (const NodeInstance &instance, instanceList) {
|
||||
for (const NodeInstance &instance : instanceList) {
|
||||
if (instance.modelNode().hasParentProperty()) {
|
||||
NodeAbstractProperty parentProperty = instance.modelNode().parentProperty();
|
||||
ReparentContainer container(instance.instanceId(), -1, PropertyName(), instanceForModelNode(parentProperty.parentModelNode()).instanceId(), parentProperty.name());
|
||||
@@ -1265,7 +1268,7 @@ ChangeValuesCommand NodeInstanceView::createChangeValueCommand(const QList<Varia
|
||||
|
||||
const bool reflectionFlag = m_puppetTransaction.isValid() && (!currentTimeline().isValid() || !currentTimeline().isRecording());
|
||||
|
||||
foreach (const VariantProperty &property, propertyList) {
|
||||
for (const VariantProperty &property : propertyList) {
|
||||
ModelNode node = property.parentModelNode();
|
||||
if (node.isValid() && hasInstanceForModelNode(node)) {
|
||||
NodeInstance instance = instanceForModelNode(node);
|
||||
@@ -1315,7 +1318,7 @@ ChangeIdsCommand NodeInstanceView::createChangeIdsCommand(const QList<NodeInstan
|
||||
RemoveInstancesCommand NodeInstanceView::createRemoveInstancesCommand(const QList<ModelNode> &nodeList) const
|
||||
{
|
||||
QVector<qint32> idList;
|
||||
foreach (const ModelNode &node, nodeList) {
|
||||
for (const ModelNode &node : nodeList) {
|
||||
if (node.isValid() && hasInstanceForModelNode(node)) {
|
||||
NodeInstance instance = instanceForModelNode(node);
|
||||
|
||||
@@ -1330,7 +1333,7 @@ RemoveInstancesCommand NodeInstanceView::createRemoveInstancesCommand(const QLis
|
||||
ChangeSelectionCommand NodeInstanceView::createChangeSelectionCommand(const QList<ModelNode> &nodeList) const
|
||||
{
|
||||
QVector<qint32> idList;
|
||||
foreach (const ModelNode &node, nodeList) {
|
||||
for (const ModelNode &node : nodeList) {
|
||||
if (node.isValid() && hasInstanceForModelNode(node)) {
|
||||
NodeInstance instance = instanceForModelNode(node);
|
||||
|
||||
@@ -1356,7 +1359,7 @@ RemovePropertiesCommand NodeInstanceView::createRemovePropertiesCommand(const QL
|
||||
{
|
||||
QVector<PropertyAbstractContainer> containerList;
|
||||
|
||||
foreach (const AbstractProperty &property, propertyList) {
|
||||
for (const AbstractProperty &property : propertyList) {
|
||||
ModelNode node = property.parentModelNode();
|
||||
if (node.isValid() && hasInstanceForModelNode(node)) {
|
||||
NodeInstance instance = instanceForModelNode(node);
|
||||
@@ -1378,7 +1381,7 @@ RemoveSharedMemoryCommand NodeInstanceView::createRemoveSharedMemoryCommand(cons
|
||||
{
|
||||
QVector<qint32> keyNumberVector;
|
||||
|
||||
foreach (const ModelNode &modelNode, nodeList)
|
||||
for (const ModelNode &modelNode : nodeList)
|
||||
keyNumberVector.append(modelNode.internalId());
|
||||
|
||||
return RemoveSharedMemoryCommand(sharedMemoryTypeName, keyNumberVector);
|
||||
@@ -1391,7 +1394,8 @@ void NodeInstanceView::valuesChanged(const ValuesChangedCommand &command)
|
||||
|
||||
QList<QPair<ModelNode, PropertyName> > valuePropertyChangeList;
|
||||
|
||||
foreach (const PropertyValueContainer &container, command.valueChanges()) {
|
||||
const QVector<PropertyValueContainer> containers = command.valueChanges();
|
||||
for (const PropertyValueContainer &container : containers) {
|
||||
if (hasInstanceForId(container.instanceId())) {
|
||||
NodeInstance instance = instanceForId(container.instanceId());
|
||||
if (instance.isValid()) {
|
||||
@@ -1439,7 +1443,8 @@ void NodeInstanceView::pixmapChanged(const PixmapChangedCommand &command)
|
||||
|
||||
QSet<ModelNode> renderImageChangeSet;
|
||||
|
||||
foreach (const ImageContainer &container, command.images()) {
|
||||
const QVector<ImageContainer> containers = command.images();
|
||||
for (const ImageContainer &container : containers) {
|
||||
if (hasInstanceForId(container.instanceId())) {
|
||||
NodeInstance instance = instanceForId(container.instanceId());
|
||||
if (instance.isValid()) {
|
||||
@@ -1459,7 +1464,7 @@ QMultiHash<ModelNode, InformationName> NodeInstanceView::informationChanged(cons
|
||||
{
|
||||
QMultiHash<ModelNode, InformationName> informationChangeHash;
|
||||
|
||||
foreach (const InformationContainer &container, containerVector) {
|
||||
for (const InformationContainer &container : containerVector) {
|
||||
if (hasInstanceForId(container.instanceId())) {
|
||||
NodeInstance instance = instanceForId(container.instanceId());
|
||||
if (instance.isValid()) {
|
||||
@@ -1517,7 +1522,8 @@ void NodeInstanceView::statePreviewImagesChanged(const StatePreviewImageChangedC
|
||||
|
||||
QVector<ModelNode> previewImageChangeVector;
|
||||
|
||||
foreach (const ImageContainer &container, command.previews()) {
|
||||
const QVector<ImageContainer> containers = command.previews();
|
||||
for (const ImageContainer &container : containers) {
|
||||
if (container.keyNumber() == -1) {
|
||||
m_baseStatePreviewImage = container.image();
|
||||
if (!container.image().isNull())
|
||||
@@ -1541,7 +1547,8 @@ void NodeInstanceView::componentCompleted(const ComponentCompletedCommand &comma
|
||||
|
||||
QVector<ModelNode> nodeVector;
|
||||
|
||||
foreach (const qint32 &instanceId, command.instances()) {
|
||||
const QVector<qint32> instances = command.instances();
|
||||
for (const qint32 &instanceId : instances) {
|
||||
if (hasModelNodeForInternalId(instanceId))
|
||||
nodeVector.append(modelNodeForInternalId(instanceId));
|
||||
}
|
||||
@@ -1559,7 +1566,8 @@ void NodeInstanceView::childrenChanged(const ChildrenChangedCommand &command)
|
||||
|
||||
QVector<ModelNode> childNodeVector;
|
||||
|
||||
foreach (qint32 instanceId, command.childrenInstances()) {
|
||||
const QVector<qint32> instances = command.childrenInstances();
|
||||
for (const qint32 &instanceId : instances) {
|
||||
if (hasInstanceForId(instanceId)) {
|
||||
NodeInstance instance = instanceForId(instanceId);
|
||||
if (instance.parentId() == -1 || !instance.directUpdates())
|
||||
@@ -1584,7 +1592,8 @@ void NodeInstanceView::token(const TokenCommand &command)
|
||||
|
||||
QVector<ModelNode> nodeVector;
|
||||
|
||||
foreach (const qint32 &instanceId, command.instances()) {
|
||||
const QVector<qint32> instances = command.instances();
|
||||
for (const qint32 &instanceId : instances) {
|
||||
if (hasModelNodeForInternalId(instanceId))
|
||||
nodeVector.append(modelNodeForInternalId(instanceId));
|
||||
}
|
||||
@@ -1599,7 +1608,8 @@ void NodeInstanceView::debugOutput(const DebugOutputCommand & command)
|
||||
emitDocumentMessage(command.text());
|
||||
} else {
|
||||
QVector<qint32> instanceIdsWithChangedErrors;
|
||||
foreach (qint32 instanceId, command.instanceIds()) {
|
||||
const QVector<qint32> instanceIds = command.instanceIds();
|
||||
for (const qint32 &instanceId : instanceIds) {
|
||||
NodeInstance instance = instanceForId(instanceId);
|
||||
if (instance.isValid()) {
|
||||
if (instance.setError(command.text()))
|
||||
@@ -1615,7 +1625,7 @@ void NodeInstanceView::debugOutput(const DebugOutputCommand & command)
|
||||
void NodeInstanceView::sendToken(const QString &token, int number, const QVector<ModelNode> &nodeVector)
|
||||
{
|
||||
QVector<qint32> instanceIdVector;
|
||||
foreach (const ModelNode &node, nodeVector)
|
||||
for (const ModelNode &node : nodeVector)
|
||||
instanceIdVector.append(node.internalId());
|
||||
|
||||
m_nodeInstanceServer->token(TokenCommand(token, number, instanceIdVector));
|
||||
@@ -1624,7 +1634,8 @@ void NodeInstanceView::sendToken(const QString &token, int number, const QVector
|
||||
void NodeInstanceView::selectionChanged(const ChangeSelectionCommand &command)
|
||||
{
|
||||
clearSelectedModelNodes();
|
||||
foreach (const qint32 &instanceId, command.instanceIds()) {
|
||||
const QVector<qint32> instanceIds = command.instanceIds();
|
||||
for (const qint32 &instanceId : instanceIds) {
|
||||
if (hasModelNodeForInternalId(instanceId))
|
||||
selectModelNode(modelNodeForInternalId(instanceId));
|
||||
}
|
||||
|
@@ -132,8 +132,9 @@ QDateTime PuppetCreator::puppetSourceLastModified() const
|
||||
};
|
||||
|
||||
QDateTime lastModified;
|
||||
foreach (const QString directoryPath, sourceDirectoryPaths) {
|
||||
foreach (const QFileInfo fileEntry, QDir(directoryPath).entryInfoList()) {
|
||||
for (const QString &directoryPath : sourceDirectoryPaths) {
|
||||
const QFileInfoList fileEntrys = QDir(directoryPath).entryInfoList();
|
||||
for (const QFileInfo &fileEntry : fileEntrys) {
|
||||
const QDateTime filePathLastModified = fileEntry.lastModified();
|
||||
if (lastModified < filePathLastModified)
|
||||
lastModified = filePathLastModified;
|
||||
|
@@ -289,7 +289,7 @@ QList<ItemLibraryEntry> ItemLibraryInfo::entriesForType(const QByteArray &typeNa
|
||||
{
|
||||
QList<ItemLibraryEntry> entries;
|
||||
|
||||
foreach (const ItemLibraryEntry &entry, m_nameToEntryHash) {
|
||||
for (const ItemLibraryEntry &entry : qAsConst(m_nameToEntryHash)) {
|
||||
if (entry.typeName() == typeName)
|
||||
entries += entry;
|
||||
}
|
||||
@@ -315,7 +315,7 @@ static inline QString keyForEntry(const ItemLibraryEntry &entry)
|
||||
|
||||
void ItemLibraryInfo::addEntries(const QList<ItemLibraryEntry> &entries, bool overwriteDuplicate)
|
||||
{
|
||||
foreach (const ItemLibraryEntry &entry, entries) {
|
||||
for (const ItemLibraryEntry &entry : entries) {
|
||||
const QString key = keyForEntry(entry);
|
||||
if (!overwriteDuplicate && m_nameToEntryHash.contains(key))
|
||||
throw InvalidMetaInfoException(__LINE__, __FUNCTION__, __FILE__);
|
||||
|
@@ -115,10 +115,10 @@ void MetaInfoPrivate::parseItemLibraryDescriptions()
|
||||
{
|
||||
#ifndef QMLDESIGNER_TEST
|
||||
Internal::WidgetPluginManager pluginManager;
|
||||
foreach (const QString &pluginDir, m_q->s_pluginDirs)
|
||||
for (const QString &pluginDir : qAsConst(m_q->s_pluginDirs))
|
||||
pluginManager.addPath(pluginDir);
|
||||
QList<IWidgetPlugin *> widgetPluginList = pluginManager.instances();
|
||||
foreach (IWidgetPlugin *plugin, widgetPluginList) {
|
||||
const QList<IWidgetPlugin *> widgetPluginList = pluginManager.instances();
|
||||
for (IWidgetPlugin *plugin : widgetPluginList) {
|
||||
Internal::MetaInfoReader reader(*m_q);
|
||||
try {
|
||||
reader.readMetaInfoFile(plugin->metaInfo());
|
||||
|
@@ -140,7 +140,8 @@ static QString qualifiedTypeNameForContext(const ObjectValue *objectValue,
|
||||
QStringList packages;
|
||||
if (const CppComponentValue *cppComponent = value_cast<CppComponentValue>(objectValue)) {
|
||||
QString className = cppComponent->className();
|
||||
foreach (const LanguageUtils::FakeMetaObject::Export &e, cppComponent->metaObject()->exports()) {
|
||||
const QList<LanguageUtils::FakeMetaObject::Export> &exports = cppComponent->metaObject()->exports();
|
||||
for (const LanguageUtils::FakeMetaObject::Export &e : exports) {
|
||||
if (e.type == className)
|
||||
packages << e.package;
|
||||
if (e.package == CppQmlTypes::cppPackage)
|
||||
@@ -160,7 +161,7 @@ static QString qualifiedTypeNameForContext(const ObjectValue *objectValue,
|
||||
CoreImport cImport = dep.coreImport(objectValue->originId());
|
||||
if (!cImport.valid())
|
||||
break;
|
||||
foreach (const Export &e, cImport.possibleExports) {
|
||||
for (const Export &e : qAsConst(cImport.possibleExports)) {
|
||||
if (e.pathRequired.isEmpty() || vContext.paths.contains(e.pathRequired)) {
|
||||
switch (e.exportName.type) {
|
||||
case ImportType::Library:
|
||||
@@ -185,7 +186,7 @@ static QString qualifiedTypeNameForContext(const ObjectValue *objectValue,
|
||||
// remove the search path prefix.
|
||||
// this means that the same relative path wrt. different import paths will clash
|
||||
QString filePath = e.exportName.path();
|
||||
foreach (const QString &path, vContext.paths) {
|
||||
for (const QString &path : qAsConst(vContext.paths)) {
|
||||
if (filePath.startsWith(path) && filePath.size() > path.size()
|
||||
&& filePath.at(path.size()) == QLatin1Char('/'))
|
||||
{
|
||||
@@ -260,7 +261,7 @@ static QString qualifiedTypeNameForContext(const ObjectValue *objectValue,
|
||||
};
|
||||
if (!possibleLibraries.isEmpty()) {
|
||||
if (hasQtQuick) {
|
||||
foreach (const QString &libImport, possibleLibraries)
|
||||
for (const QString &libImport : qAsConst(possibleLibraries))
|
||||
if (!libImport.startsWith(QLatin1String("QtQuick")))
|
||||
possibleLibraries.removeAll(libImport);
|
||||
}
|
||||
@@ -456,8 +457,8 @@ QVector<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Co
|
||||
//dot property
|
||||
const CppComponentValue * qmlValue = value_cast<CppComponentValue>(objectValue->lookupMember(nameAsString, context));
|
||||
if (qmlValue) {
|
||||
QVector<PropertyInfo> dotProperties = getQmlTypes(qmlValue, context, false, rec + 1);
|
||||
foreach (const PropertyInfo &propertyInfo, dotProperties) {
|
||||
const QVector<PropertyInfo> dotProperties = getQmlTypes(qmlValue, context, false, rec + 1);
|
||||
for (const PropertyInfo &propertyInfo : dotProperties) {
|
||||
const PropertyName dotName = name + '.' + propertyInfo.first;
|
||||
const TypeName type = propertyInfo.second;
|
||||
propertyList.append({dotName, type});
|
||||
@@ -467,8 +468,8 @@ QVector<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Co
|
||||
if (isValueType(objectValue->propertyType(nameAsString))) {
|
||||
const ObjectValue *dotObjectValue = value_cast<ObjectValue>(objectValue->lookupMember(nameAsString, context));
|
||||
if (dotObjectValue) {
|
||||
QVector<PropertyInfo> dotProperties = getObjectTypes(dotObjectValue, context, false, rec + 1);
|
||||
foreach (const PropertyInfo &propertyInfo, dotProperties) {
|
||||
const QVector<PropertyInfo> dotProperties = getObjectTypes(dotObjectValue, context, false, rec + 1);
|
||||
for (const PropertyInfo &propertyInfo : dotProperties) {
|
||||
const PropertyName dotName = name + '.' + propertyInfo.first;
|
||||
const TypeName type = propertyInfo.second;
|
||||
propertyList.append({dotName, type});
|
||||
@@ -825,7 +826,7 @@ const CppComponentValue *NodeMetaInfoPrivate::getCppComponentValue() const
|
||||
const QmlJS::Imports *importsPtr = context()->imports(document());
|
||||
if (importsPtr) {
|
||||
const QList<QmlJS::Import> &imports = importsPtr->all();
|
||||
foreach (const QmlJS::Import &import, imports) {
|
||||
for (const QmlJS::Import &import : imports) {
|
||||
if (import.info.path() != QString::fromUtf8(module))
|
||||
continue;
|
||||
const Value *lookupResult = import.object->lookupMember(QString::fromUtf8(type), context());
|
||||
@@ -846,9 +847,11 @@ const CppComponentValue *NodeMetaInfoPrivate::getCppComponentValue() const
|
||||
const CppComponentValue *cppValue = context()->valueOwner()->cppQmlTypes().objectByCppName(QString::fromUtf8(type));
|
||||
|
||||
if (cppValue) {
|
||||
foreach (const LanguageUtils::FakeMetaObject::Export &exportValue, cppValue->metaObject()->exports()) {
|
||||
const QList<LanguageUtils::FakeMetaObject::Export> exports = cppValue->metaObject()->exports();
|
||||
for (const LanguageUtils::FakeMetaObject::Export &exportValue : exports) {
|
||||
if (exportValue.package.toUtf8() != "<cpp>") {
|
||||
foreach (const QmlJS::Import &import, context()->imports(document())->all()) {
|
||||
const QList<QmlJS::Import> imports = context()->imports(document())->all();
|
||||
for (const QmlJS::Import &import : imports) {
|
||||
if (import.info.path() != exportValue.package)
|
||||
continue;
|
||||
const Value *lookupResult = import.object->lookupMember(exportValue.type, context());
|
||||
@@ -884,14 +887,14 @@ const Document *NodeMetaInfoPrivate::document() const
|
||||
|
||||
void NodeMetaInfoPrivate::setupLocalPropertyInfo(const QVector<PropertyInfo> &localPropertyInfos)
|
||||
{
|
||||
foreach (const PropertyInfo &propertyInfo, localPropertyInfos) {
|
||||
for (const PropertyInfo &propertyInfo : localPropertyInfos) {
|
||||
m_localProperties.append(propertyInfo.first);
|
||||
}
|
||||
}
|
||||
|
||||
void NodeMetaInfoPrivate::setupPropertyInfo(const QVector<PropertyInfo> &propertyInfos)
|
||||
{
|
||||
foreach (const PropertyInfo &propertyInfo, propertyInfos) {
|
||||
for (const PropertyInfo &propertyInfo : propertyInfos) {
|
||||
if (!m_properties.contains(propertyInfo.first)) {
|
||||
m_properties.append(propertyInfo.first);
|
||||
m_propertyTypes.append(propertyInfo.second);
|
||||
@@ -1197,7 +1200,8 @@ QString NodeMetaInfoPrivate::importDirectoryPath() const
|
||||
return importInfo.path();
|
||||
} else if (importInfo.type() == ImportType::Library) {
|
||||
if (modelManager) {
|
||||
foreach (const QString &importPath, model()->importPaths()) {
|
||||
const QStringList importPaths = model()->importPaths();
|
||||
for (const QString &importPath : importPaths) {
|
||||
const QString targetPath = QDir(importPath).filePath(importInfo.path());
|
||||
if (QDir(targetPath).exists())
|
||||
return targetPath;
|
||||
@@ -1271,7 +1275,7 @@ void NodeMetaInfoPrivate::setupPrototypes()
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (const ObjectValue *ov, objects) {
|
||||
for (const ObjectValue *ov : qAsConst(objects)) {
|
||||
TypeDescription description;
|
||||
description.className = ov->className();
|
||||
description.minorVersion = -1;
|
||||
@@ -1301,7 +1305,8 @@ void NodeMetaInfoPrivate::setupPrototypes()
|
||||
} else {
|
||||
bool found = false;
|
||||
if (cppExport.isValid()) {
|
||||
foreach (const LanguageUtils::FakeMetaObject::Export &exportValue, qmlValue->metaObject()->exports()) {
|
||||
const QList<LanguageUtils::FakeMetaObject::Export> exports = qmlValue->metaObject()->exports();
|
||||
for (const LanguageUtils::FakeMetaObject::Export &exportValue : exports) {
|
||||
if (exportValue.package.toUtf8() != "<cpp>") {
|
||||
found = true;
|
||||
description.className = exportValue.package + '.' + exportValue.type;
|
||||
@@ -1612,7 +1617,8 @@ bool NodeMetaInfo::isSubclassOf(const TypeName &type, int majorVersion, int mino
|
||||
if (m_privateData->prototypeCacheNegatives().contains(Internal::stringIdentifier(type, majorVersion, minorVersion)))
|
||||
return false; //take a shortcut - optimization
|
||||
|
||||
foreach (const NodeMetaInfo &superClass, superClasses()) {
|
||||
const QList<NodeMetaInfo> superClassList = superClasses();
|
||||
for (const NodeMetaInfo &superClass : superClassList) {
|
||||
if (superClass.m_privateData->cleverCheckType(type)
|
||||
&& superClass.availableInVersion(majorVersion, minorVersion)) {
|
||||
m_privateData->prototypeCachePositives().insert(Internal::stringIdentifier(type, majorVersion, minorVersion));
|
||||
|
@@ -173,7 +173,7 @@ void SubComponentManager::parseDirectories()
|
||||
for (const auto &assetPath : assetPaths)
|
||||
parseDirectory(assetPath);
|
||||
|
||||
foreach (const Import &import, m_imports) {
|
||||
for (const Import &import : qAsConst(m_imports)) {
|
||||
if (import.isFileImport()) {
|
||||
QFileInfo dirInfo = QFileInfo(m_filePath.resolved(import.file()).toLocalFile());
|
||||
if (dirInfo.exists() && dirInfo.isDir()) {
|
||||
@@ -184,7 +184,8 @@ void SubComponentManager::parseDirectories()
|
||||
QString url = import.url();
|
||||
url.replace(QLatin1Char('.'), QLatin1Char('/'));
|
||||
QFileInfo dirInfo = QFileInfo(url);
|
||||
foreach (const QString &path, importPaths()) {
|
||||
const QStringList paths = importPaths();
|
||||
for (const QString &path : paths) {
|
||||
QString fullUrl = path + QLatin1Char('/') + url;
|
||||
dirInfo = QFileInfo(fullUrl);
|
||||
|
||||
@@ -222,7 +223,8 @@ void SubComponentManager::parseDirectory(const QString &canonicalDirPath, bool a
|
||||
designerDir.setNameFilters(filter);
|
||||
|
||||
QStringList metaFiles = designerDir.entryList(QDir::Files);
|
||||
foreach (const QFileInfo &metaInfoFile, designerDir.entryInfoList(QDir::Files)) {
|
||||
const QFileInfoList metaInfoList = designerDir.entryInfoList(QDir::Files);
|
||||
for (const QFileInfo &metaInfoFile : metaInfoList) {
|
||||
if (model() && model()->metaInfo().itemLibraryInfo()) {
|
||||
Internal::MetaInfoReader reader(model()->metaInfo());
|
||||
reader.setQualifcation(qualification);
|
||||
@@ -250,7 +252,8 @@ void SubComponentManager::parseDirectory(const QString &canonicalDirPath, bool a
|
||||
|
||||
QFileInfoList monitoredList = watchedFiles(canonicalDirPath);
|
||||
QFileInfoList newList;
|
||||
foreach (const QFileInfo &qmlFile, dir.entryInfoList()) {
|
||||
const QFileInfoList qmlFileList = dir.entryInfoList();
|
||||
for (const QFileInfo &qmlFile : qmlFileList) {
|
||||
if (QFileInfo(m_filePath.toLocalFile()) == qmlFile) {
|
||||
// do not parse main file
|
||||
continue;
|
||||
@@ -279,7 +282,8 @@ void SubComponentManager::parseDirectory(const QString &canonicalDirPath, bool a
|
||||
continue;
|
||||
}
|
||||
if (oldFileInfo < newFileInfo) {
|
||||
foreach (const QString &qualifier, m_dirToQualifier.value(canonicalDirPath))
|
||||
const QString qualifiers = m_dirToQualifier.value(canonicalDirPath);
|
||||
for (const QChar &qualifier : qualifiers)
|
||||
unregisterQmlFile(oldFileInfo, qualifier);
|
||||
m_watcher.removePath(oldFileInfo.filePath());
|
||||
++oldIter;
|
||||
@@ -291,7 +295,8 @@ void SubComponentManager::parseDirectory(const QString &canonicalDirPath, bool a
|
||||
}
|
||||
|
||||
while (oldIter != monitoredList.constEnd()) {
|
||||
foreach (const QString &qualifier, m_dirToQualifier.value(canonicalDirPath))
|
||||
const QString qualifiers = m_dirToQualifier.value(canonicalDirPath);
|
||||
for (const QChar &qualifier : qualifiers)
|
||||
unregisterQmlFile(*oldIter, qualifier);
|
||||
++oldIter;
|
||||
}
|
||||
@@ -315,7 +320,8 @@ void SubComponentManager::parseFile(const QString &canonicalFilePath, bool addTo
|
||||
|
||||
const QFileInfo fi(canonicalFilePath);
|
||||
const QString dir = fi.path();
|
||||
foreach (const QString &qualifier, m_dirToQualifier.values(dir)) {
|
||||
const QStringList qualifiers = m_dirToQualifier.values(dir);
|
||||
for (const QString &qualifier : qualifiers) {
|
||||
registerQmlFile(fi, qualifier, addToLibrary);
|
||||
}
|
||||
registerQmlFile(fi, qualification, addToLibrary);
|
||||
@@ -331,7 +337,8 @@ QFileInfoList SubComponentManager::watchedFiles(const QString &canonicalDirPath)
|
||||
{
|
||||
QFileInfoList files;
|
||||
|
||||
foreach (const QString &monitoredFile, m_watcher.files()) {
|
||||
const QStringList monitoredFiles = m_watcher.files();
|
||||
for (const QString &monitoredFile : monitoredFiles) {
|
||||
QFileInfo fileInfo(monitoredFile);
|
||||
if (fileInfo.dir().absolutePath() == canonicalDirPath)
|
||||
files.append(fileInfo);
|
||||
|
@@ -825,7 +825,8 @@ QmlTimeline AbstractView::currentTimeline() const
|
||||
|
||||
static int getMinorVersionFromImport(const Model *model)
|
||||
{
|
||||
foreach (const Import &import, model->imports()) {
|
||||
const QList<Import> imports = model->imports();
|
||||
for (const Import &import : imports) {
|
||||
if (import.isLibraryImport() && import.url() == "QtQuick") {
|
||||
const QString versionString = import.version();
|
||||
if (versionString.contains(".")) {
|
||||
@@ -840,7 +841,8 @@ static int getMinorVersionFromImport(const Model *model)
|
||||
|
||||
static int getMajorVersionFromImport(const Model *model)
|
||||
{
|
||||
foreach (const Import &import, model->imports()) {
|
||||
const QList<Import> imports = model->imports();
|
||||
for (const Import &import : imports) {
|
||||
if (import.isLibraryImport() && import.url() == QStringLiteral("QtQuick")) {
|
||||
const QString versionString = import.version();
|
||||
if (versionString.contains(QStringLiteral("."))) {
|
||||
@@ -870,7 +872,8 @@ static int getMajorVersionFromNode(const ModelNode &modelNode)
|
||||
static int getMinorVersionFromNode(const ModelNode &modelNode)
|
||||
{
|
||||
if (modelNode.metaInfo().isValid()) {
|
||||
foreach (const NodeMetaInfo &info, modelNode.metaInfo().classHierarchy()) {
|
||||
const QList<NodeMetaInfo> infos = modelNode.metaInfo().classHierarchy();
|
||||
for (const NodeMetaInfo &info : infos) {
|
||||
if (info.typeName() == "QtQuick.QtObject" || info.typeName() == "QtQuick.Item")
|
||||
return info.minorVersion();
|
||||
}
|
||||
|
@@ -95,8 +95,9 @@ bool BaseTextEditModifier::renameId(const QString &oldId, const QString &newId)
|
||||
if (auto document = qobject_cast<QmlJSEditor::QmlJSEditorDocument *>(
|
||||
m_textEdit->textDocument())) {
|
||||
Utils::ChangeSet changeSet;
|
||||
foreach (const QmlJS::SourceLocation &loc,
|
||||
document->semanticInfo().idLocations.value(oldId)) {
|
||||
const QList<QmlJS::SourceLocation> locations = document->semanticInfo()
|
||||
.idLocations.value(oldId);
|
||||
for (const QmlJS::SourceLocation &loc : locations) {
|
||||
changeSet.replace(loc.begin(), loc.end(), newId);
|
||||
}
|
||||
QTextCursor tc = textCursor();
|
||||
|
@@ -142,9 +142,9 @@ ModelNode BindingProperty::resolveToModelNode() const
|
||||
|
||||
static inline QStringList commaSeparatedSimplifiedStringList(const QString &string)
|
||||
{
|
||||
QStringList stringList = string.split(QStringLiteral(","));
|
||||
const QStringList stringList = string.split(QStringLiteral(","));
|
||||
QStringList simpleList;
|
||||
foreach (const QString &simpleString, stringList)
|
||||
for (const QString &simpleString : stringList)
|
||||
simpleList.append(simpleString.simplified());
|
||||
return simpleList;
|
||||
}
|
||||
@@ -190,8 +190,8 @@ QList<ModelNode> BindingProperty::resolveToModelNodeList() const
|
||||
QString string = expression();
|
||||
string.chop(1);
|
||||
string.remove(0, 1);
|
||||
QStringList simplifiedList = commaSeparatedSimplifiedStringList(string);
|
||||
foreach (const QString &nodeId, simplifiedList) {
|
||||
const QStringList simplifiedList = commaSeparatedSimplifiedStringList(string);
|
||||
for (const QString &nodeId : simplifiedList) {
|
||||
if (view()->hasId(nodeId))
|
||||
returnList.append(view()->modelNodeForId(nodeId));
|
||||
}
|
||||
|
@@ -311,7 +311,8 @@ QList<InternalProperty::Pointer> InternalNode::propertyList() const
|
||||
QList<InternalNodeAbstractProperty::Pointer> InternalNode::nodeAbstractPropertyList() const
|
||||
{
|
||||
QList<InternalNodeAbstractProperty::Pointer> abstractPropertyList;
|
||||
foreach (const InternalProperty::Pointer &property, propertyList()) {
|
||||
const QList<InternalProperty::Pointer> properties = propertyList();
|
||||
for (const InternalProperty::Pointer &property : properties) {
|
||||
if (property->isNodeAbstractProperty())
|
||||
abstractPropertyList.append(property->toNodeAbstractProperty());
|
||||
}
|
||||
@@ -323,7 +324,8 @@ QList<InternalNodeAbstractProperty::Pointer> InternalNode::nodeAbstractPropertyL
|
||||
QList<InternalNode::Pointer> InternalNode::allSubNodes() const
|
||||
{
|
||||
QList<InternalNode::Pointer> nodeList;
|
||||
foreach (const InternalNodeAbstractProperty::Pointer &property, nodeAbstractPropertyList()) {
|
||||
const QList<InternalNodeAbstractProperty::Pointer> properties = nodeAbstractPropertyList();
|
||||
for (const InternalNodeAbstractProperty::Pointer &property : properties) {
|
||||
nodeList.append(property->allSubNodes());
|
||||
}
|
||||
|
||||
@@ -333,7 +335,8 @@ QList<InternalNode::Pointer> InternalNode::allSubNodes() const
|
||||
QList<InternalNode::Pointer> InternalNode::allDirectSubNodes() const
|
||||
{
|
||||
QList<InternalNode::Pointer> nodeList;
|
||||
foreach (const InternalNodeAbstractProperty::Pointer &property, nodeAbstractPropertyList()) {
|
||||
const QList<InternalNodeAbstractProperty::Pointer> properties = nodeAbstractPropertyList();
|
||||
for (const InternalNodeAbstractProperty::Pointer &property : properties) {
|
||||
nodeList.append(property->directSubNodes());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user