forked from qt-creator/qt-creator
qml2puppet: Remove foreach usage
Change-Id: I00af71e640a46962f987f7eb7d360f04d68f23ea Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -14,7 +14,7 @@ ChangeValuesCommand::ChangeValuesCommand(const QVector<PropertyValueContainer> &
|
||||
{
|
||||
}
|
||||
|
||||
QVector<PropertyValueContainer> ChangeValuesCommand::valueChanges() const
|
||||
const QVector<PropertyValueContainer> ChangeValuesCommand::valueChanges() const
|
||||
{
|
||||
return m_valueChangeVector;
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ public:
|
||||
ChangeValuesCommand();
|
||||
explicit ChangeValuesCommand(const QVector<PropertyValueContainer> &valueChangeVector);
|
||||
|
||||
QVector<PropertyValueContainer> valueChanges() const;
|
||||
const QVector<PropertyValueContainer> valueChanges() const;
|
||||
|
||||
private:
|
||||
QVector<PropertyValueContainer> m_valueChangeVector;
|
||||
|
@@ -15,7 +15,7 @@ CompleteComponentCommand::CompleteComponentCommand(const QVector<qint32> &contai
|
||||
{
|
||||
}
|
||||
|
||||
QVector<qint32> CompleteComponentCommand::instances() const
|
||||
const QVector<qint32> CompleteComponentCommand::instances() const
|
||||
{
|
||||
return m_instanceVector;
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ public:
|
||||
CompleteComponentCommand();
|
||||
explicit CompleteComponentCommand(const QVector<qint32> &container);
|
||||
|
||||
QVector<qint32> instances() const;
|
||||
const QVector<qint32> instances() const;
|
||||
|
||||
private:
|
||||
QVector<qint32> m_instanceVector;
|
||||
|
@@ -15,7 +15,7 @@ RemoveInstancesCommand::RemoveInstancesCommand(const QVector<qint32> &idVector)
|
||||
{
|
||||
}
|
||||
|
||||
QVector<qint32> RemoveInstancesCommand::instanceIds() const
|
||||
const QVector<qint32> RemoveInstancesCommand::instanceIds() const
|
||||
{
|
||||
return m_instanceIdVector;
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ public:
|
||||
RemoveInstancesCommand();
|
||||
explicit RemoveInstancesCommand(const QVector<qint32> &idVector);
|
||||
|
||||
QVector<qint32> instanceIds() const;
|
||||
const QVector<qint32> instanceIds() const;
|
||||
|
||||
private:
|
||||
QVector<qint32> m_instanceIdVector;
|
||||
|
@@ -14,7 +14,7 @@ RemovePropertiesCommand::RemovePropertiesCommand(const QVector<PropertyAbstractC
|
||||
{
|
||||
}
|
||||
|
||||
QVector<PropertyAbstractContainer> RemovePropertiesCommand::properties() const
|
||||
const QVector<PropertyAbstractContainer> RemovePropertiesCommand::properties() const
|
||||
{
|
||||
return m_properties;
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ public:
|
||||
RemovePropertiesCommand();
|
||||
explicit RemovePropertiesCommand(const QVector<PropertyAbstractContainer> &properties);
|
||||
|
||||
QVector<PropertyAbstractContainer> properties() const;
|
||||
const QVector<PropertyAbstractContainer> properties() const;
|
||||
|
||||
private:
|
||||
QVector<PropertyAbstractContainer> m_properties;
|
||||
|
@@ -15,7 +15,7 @@ ReparentInstancesCommand::ReparentInstancesCommand(const QVector<ReparentContain
|
||||
{
|
||||
}
|
||||
|
||||
QVector<ReparentContainer> ReparentInstancesCommand::reparentInstances() const
|
||||
const QVector<ReparentContainer> ReparentInstancesCommand::reparentInstances() const
|
||||
{
|
||||
return m_reparentInstanceVector;
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ public:
|
||||
ReparentInstancesCommand();
|
||||
explicit ReparentInstancesCommand(const QVector<ReparentContainer> &container);
|
||||
|
||||
QVector<ReparentContainer> reparentInstances() const;
|
||||
const QVector<ReparentContainer> reparentInstances() const;
|
||||
|
||||
private:
|
||||
QVector<ReparentContainer> m_reparentInstanceVector;
|
||||
|
@@ -87,7 +87,8 @@ int NodeInstanceSignalSpy::qt_metacall(QMetaObject::Call call, int methodId, voi
|
||||
ObjectNodeInstance::Pointer nodeInstance = m_objectNodeInstance.toStrongRef();
|
||||
|
||||
if (nodeInstance && nodeInstance->nodeInstanceServer() && nodeInstance->isValid()) {
|
||||
foreach (const PropertyName &propertyName, m_indexPropertyHash.values(methodId))
|
||||
const QList<PropertyName> values = m_indexPropertyHash.values(methodId);
|
||||
for (const PropertyName &propertyName : values)
|
||||
nodeInstance->nodeInstanceServer()->notifyPropertyChange(nodeInstance->instanceId(), propertyName);
|
||||
}
|
||||
|
||||
|
@@ -300,7 +300,7 @@ static void removeObjectFromList(const QQmlProperty &property,
|
||||
|
||||
listReference.clear();
|
||||
|
||||
foreach (QObject *object, objectList)
|
||||
for (QObject *object : std::as_const(objectList))
|
||||
listReference.append(object);
|
||||
}
|
||||
|
||||
@@ -761,7 +761,8 @@ QObject *ObjectNodeInstance::createComponentWrap(const QString &nodeSource, cons
|
||||
|
||||
if (component->isError()) {
|
||||
qWarning() << "Error in:" << Q_FUNC_INFO << component->url().toString();
|
||||
foreach (const QQmlError &error, component->errors())
|
||||
const QList<QQmlError> errors = component->errors();
|
||||
for (const QQmlError &error : errors)
|
||||
qWarning() << error;
|
||||
qWarning() << "file data:\n" << data;
|
||||
}
|
||||
@@ -812,7 +813,8 @@ QObject *ObjectNodeInstance::createComponent([[maybe_unused]] const QString &com
|
||||
|
||||
if (component.isError()) {
|
||||
qDebug() << componentPath;
|
||||
foreach (const QQmlError &error, component.errors())
|
||||
const QList<QQmlError> errors = component.errors();
|
||||
for (const QQmlError &error : errors)
|
||||
qWarning() << error;
|
||||
}
|
||||
|
||||
@@ -847,7 +849,8 @@ QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource,
|
||||
|
||||
if (component.isError()) {
|
||||
qWarning() << "Error in:" << Q_FUNC_INFO << component.url().toString();
|
||||
foreach (const QQmlError &error, component.errors())
|
||||
const QList<QQmlError> errors = component.errors();
|
||||
for (const QQmlError &error : errors)
|
||||
qWarning() << error;
|
||||
qWarning() << "file data:\n" << data;
|
||||
}
|
||||
|
@@ -1448,7 +1448,7 @@ Qt5InformationNodeInstanceServer::~Qt5InformationNodeInstanceServer()
|
||||
|
||||
void Qt5InformationNodeInstanceServer::sendTokenBack()
|
||||
{
|
||||
foreach (const TokenCommand &command, m_tokenList)
|
||||
for (const TokenCommand &command : std::as_const(m_tokenList))
|
||||
nodeInstanceClient()->token(command);
|
||||
|
||||
m_tokenList.clear();
|
||||
@@ -1471,7 +1471,8 @@ bool Qt5InformationNodeInstanceServer::isDirtyRecursiveForNonInstanceItems(QQuic
|
||||
if (QQuickDesignerSupport::isDirty(item, informationsDirty))
|
||||
return true;
|
||||
|
||||
foreach (QQuickItem *childItem, item->childItems()) {
|
||||
const QList<QQuickItem *> childItems = item->childItems();
|
||||
for (QQuickItem *childItem : childItems) {
|
||||
if (!hasInstanceForObject(childItem)) {
|
||||
if (QQuickDesignerSupport::isDirty(childItem, informationsDirty))
|
||||
return true;
|
||||
@@ -1971,7 +1972,7 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
||||
QVector<InstancePropertyPair> propertyChangedList;
|
||||
|
||||
if (quickWindow()) {
|
||||
foreach (QQuickItem *item, allItems()) {
|
||||
for (QQuickItem *item : allItems()) {
|
||||
if (item && hasInstanceForObject(item)) {
|
||||
ServerNodeInstance instance = instanceForObject(item);
|
||||
|
||||
@@ -1987,7 +1988,7 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const InstancePropertyPair& property, changedPropertyList()) {
|
||||
for (const InstancePropertyPair& property : changedPropertyList()) {
|
||||
const ServerNodeInstance instance = property.first;
|
||||
if (instance.isValid()) {
|
||||
if (property.second.contains("anchors"))
|
||||
@@ -2031,7 +2032,7 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
||||
|
||||
void Qt5InformationNodeInstanceServer::reparentInstances(const ReparentInstancesCommand &command)
|
||||
{
|
||||
foreach (const ReparentContainer &container, command.reparentInstances()) {
|
||||
for (const ReparentContainer &container : command.reparentInstances()) {
|
||||
if (hasInstanceForId(container.instanceId())) {
|
||||
ServerNodeInstance instance = instanceForId(container.instanceId());
|
||||
if (instance.isValid()) {
|
||||
@@ -2094,7 +2095,7 @@ void Qt5InformationNodeInstanceServer::sendChildrenChangedCommand(const QList<Se
|
||||
QSet<ServerNodeInstance> parentSet;
|
||||
QList<ServerNodeInstance> noParentList;
|
||||
|
||||
foreach (const ServerNodeInstance &child, childList) {
|
||||
for (const ServerNodeInstance &child : childList) {
|
||||
if (child.isValid()) {
|
||||
if (!child.hasParent()) {
|
||||
noParentList.append(child);
|
||||
@@ -2109,7 +2110,7 @@ void Qt5InformationNodeInstanceServer::sendChildrenChangedCommand(const QList<Se
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const ServerNodeInstance &parent, parentSet)
|
||||
for (const ServerNodeInstance &parent : std::as_const(parentSet))
|
||||
nodeInstanceClient()->childrenChanged(createChildrenChangedCommand(parent, parent.childItems()));
|
||||
|
||||
if (!noParentList.isEmpty())
|
||||
@@ -2122,7 +2123,8 @@ void Qt5InformationNodeInstanceServer::completeComponent(const CompleteComponent
|
||||
Qt5NodeInstanceServer::completeComponent(command);
|
||||
|
||||
QList<ServerNodeInstance> instanceList;
|
||||
foreach (qint32 instanceId, command.instances()) {
|
||||
QList<qint32> instances = command.instances();
|
||||
for (qint32 instanceId : instances) {
|
||||
if (hasInstanceForId(instanceId)) {
|
||||
ServerNodeInstance instance = instanceForId(instanceId);
|
||||
if (instance.isValid()) {
|
||||
|
@@ -147,7 +147,7 @@ void Qt5NodeInstanceServer::resizeCanvasToRootItem()
|
||||
|
||||
void Qt5NodeInstanceServer::resetAllItems()
|
||||
{
|
||||
foreach (QQuickItem *item, allItems())
|
||||
for (QQuickItem *item : allItems())
|
||||
QQuickDesignerSupport::resetDirty(item);
|
||||
}
|
||||
|
||||
@@ -167,13 +167,14 @@ QList<QQuickItem*> subItems(QQuickItem *parentItem)
|
||||
QList<QQuickItem*> itemList;
|
||||
itemList.append(parentItem->childItems());
|
||||
|
||||
foreach (QQuickItem *childItem, parentItem->childItems())
|
||||
const QList<QQuickItem *> childItems = parentItem->childItems();
|
||||
for (QQuickItem *childItem : childItems)
|
||||
itemList.append(subItems(childItem));
|
||||
|
||||
return itemList;
|
||||
}
|
||||
|
||||
QList<QQuickItem*> Qt5NodeInstanceServer::allItems() const
|
||||
const QList<QQuickItem*> Qt5NodeInstanceServer::allItems() const
|
||||
{
|
||||
if (rootNodeInstance().isValid())
|
||||
return rootNodeInstance().allItemsRecursive();
|
||||
|
@@ -57,7 +57,7 @@ protected:
|
||||
void resizeCanvasToRootItem() override;
|
||||
void resetAllItems();
|
||||
void setupScene(const CreateSceneCommand &command) override;
|
||||
QList<QQuickItem*> allItems() const;
|
||||
const QList<QQuickItem*> allItems() const;
|
||||
bool rootIsRenderable3DObject() const;
|
||||
|
||||
struct RenderViewData {
|
||||
|
@@ -56,7 +56,7 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
||||
|
||||
if (quickWindow() && nodeInstanceClient()->bytesToWrite() < 10000) {
|
||||
bool windowDirty = false;
|
||||
foreach (QQuickItem *item, allItems()) {
|
||||
for (QQuickItem *item : allItems()) {
|
||||
if (item) {
|
||||
if (Internal::QuickItemNodeInstance::unifiedRenderPath()) {
|
||||
if (QQuickDesignerSupport::isDirty(item, QQuickDesignerSupport::AllMask)) {
|
||||
|
@@ -67,7 +67,7 @@ void Qt5TestNodeInstanceServer::changeFileUrl(const ChangeFileUrlCommand &comman
|
||||
void Qt5TestNodeInstanceServer::changePropertyValues(const ChangeValuesCommand &command)
|
||||
{
|
||||
bool hasDynamicProperties = false;
|
||||
foreach (const PropertyValueContainer &container, command.valueChanges()) {
|
||||
for (const PropertyValueContainer &container : command.valueChanges()) {
|
||||
hasDynamicProperties |= container.isDynamic();
|
||||
setInstancePropertyVariant(container);
|
||||
}
|
||||
@@ -140,7 +140,7 @@ void Qt5TestNodeInstanceServer::removeInstances(const RemoveInstancesCommand &co
|
||||
if (activeStateInstance().isValid())
|
||||
activeStateInstance().deactivateState();
|
||||
|
||||
foreach (qint32 instanceId, command.instanceIds()) {
|
||||
for (qint32 instanceId : command.instanceIds()) {
|
||||
removeInstanceRelationsip(instanceId);
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ void Qt5TestNodeInstanceServer::removeInstances(const RemoveInstancesCommand &co
|
||||
void Qt5TestNodeInstanceServer::removeProperties(const RemovePropertiesCommand &command)
|
||||
{
|
||||
bool hasDynamicProperties = false;
|
||||
foreach (const PropertyAbstractContainer &container, command.properties()) {
|
||||
for (const PropertyAbstractContainer &container : command.properties()) {
|
||||
hasDynamicProperties |= container.isDynamic();
|
||||
resetInstanceProperty(container);
|
||||
}
|
||||
@@ -168,7 +168,7 @@ void Qt5TestNodeInstanceServer::removeProperties(const RemovePropertiesCommand &
|
||||
|
||||
void Qt5TestNodeInstanceServer::reparentInstances(const ReparentInstancesCommand &command)
|
||||
{
|
||||
foreach (const ReparentContainer &container, command.reparentInstances()) {
|
||||
for (const ReparentContainer &container : command.reparentInstances()) {
|
||||
if (hasInstanceForId(container.instanceId())) {
|
||||
ServerNodeInstance instance = instanceForId(container.instanceId());
|
||||
if (instance.isValid()) {
|
||||
@@ -201,7 +201,7 @@ void Qt5TestNodeInstanceServer::completeComponent(const CompleteComponentCommand
|
||||
{
|
||||
QList<ServerNodeInstance> instanceList;
|
||||
|
||||
foreach (qint32 instanceId, command.instances()) {
|
||||
for (qint32 instanceId : command.instances()) {
|
||||
if (hasInstanceForId(instanceId)) {
|
||||
ServerNodeInstance instance = instanceForId(instanceId);
|
||||
instance.doComponentComplete();
|
||||
@@ -242,7 +242,7 @@ void QmlDesigner::Qt5TestNodeInstanceServer::collectItemChangesAndSendChangeComm
|
||||
QSet<ServerNodeInstance> parentChangedSet;
|
||||
|
||||
if (quickWindow()) {
|
||||
foreach (QQuickItem *item, allItems()) {
|
||||
for (QQuickItem *item : allItems()) {
|
||||
if (item && hasInstanceForObject(item)) {
|
||||
ServerNodeInstance instance = instanceForObject(item);
|
||||
|
||||
@@ -257,7 +257,7 @@ void QmlDesigner::Qt5TestNodeInstanceServer::collectItemChangesAndSendChangeComm
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const InstancePropertyPair& property, changedPropertyList()) {
|
||||
for (const InstancePropertyPair& property : changedPropertyList()) {
|
||||
const ServerNodeInstance instance = property.first;
|
||||
if (instance.isValid()) {
|
||||
if (property.second.contains("anchors"))
|
||||
@@ -292,7 +292,7 @@ void Qt5TestNodeInstanceServer::sendChildrenChangedCommand(const QList<ServerNod
|
||||
QSet<ServerNodeInstance> parentSet;
|
||||
QList<ServerNodeInstance> noParentList;
|
||||
|
||||
foreach (const ServerNodeInstance &child, childList) {
|
||||
for (const ServerNodeInstance &child : childList) {
|
||||
if (!child.hasParent()) {
|
||||
noParentList.append(child);
|
||||
} else {
|
||||
@@ -305,7 +305,7 @@ void Qt5TestNodeInstanceServer::sendChildrenChangedCommand(const QList<ServerNod
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const ServerNodeInstance &parent, parentSet) {
|
||||
for (const ServerNodeInstance &parent : std::as_const(parentSet)) {
|
||||
ChildrenChangedCommand command = createChildrenChangedCommand(parent, parent.childItems());
|
||||
command.sort();
|
||||
nodeInstanceClient()->childrenChanged(command);
|
||||
@@ -329,7 +329,8 @@ bool Qt5TestNodeInstanceServer::isDirtyRecursiveForNonInstanceItems(QQuickItem *
|
||||
if (QQuickDesignerSupport::isDirty(item, informationsDirty))
|
||||
return true;
|
||||
|
||||
foreach (QQuickItem *childItem, item->childItems()) {
|
||||
const QList<QQuickItem *> childItems = item->childItems();
|
||||
for (QQuickItem *childItem : childItems) {
|
||||
if (!hasInstanceForObject(childItem)) {
|
||||
if (QQuickDesignerSupport::isDirty(childItem, informationsDirty))
|
||||
return true;
|
||||
|
@@ -95,7 +95,8 @@ QList<ServerNodeInstance> QuickItemNodeInstance::childItems() const
|
||||
{
|
||||
QList<ServerNodeInstance> instanceList;
|
||||
|
||||
foreach (QQuickItem *childItem, quickItem()->childItems())
|
||||
const QList<QQuickItem *> childItems = quickItem()->childItems();
|
||||
for (QQuickItem *childItem : childItems)
|
||||
{
|
||||
if (childItem && nodeInstanceServer()->hasInstanceForObject(childItem)) {
|
||||
instanceList.append(nodeInstanceServer()->instanceForObject(childItem));
|
||||
@@ -216,7 +217,8 @@ static QList<QQuickItem *> allChildItemsRecursive(QQuickItem *parentItem)
|
||||
|
||||
itemList.append(parentItem->childItems());
|
||||
|
||||
foreach (QQuickItem *childItem, parentItem->childItems())
|
||||
const QList<QQuickItem *> childItems = parentItem->childItems();
|
||||
for (QQuickItem *childItem : childItems)
|
||||
itemList.append(allChildItemsRecursive(childItem));
|
||||
|
||||
return itemList;
|
||||
@@ -556,8 +558,8 @@ bool QuickItemNodeInstance::isRenderable() const
|
||||
QList<ServerNodeInstance> QuickItemNodeInstance::stateInstances() const
|
||||
{
|
||||
QList<ServerNodeInstance> instanceList;
|
||||
QList<QObject*> stateList = QQuickDesignerSupport::statesForItem(quickItem());
|
||||
foreach (QObject *state, stateList)
|
||||
const QList<QObject*> stateList = QQuickDesignerSupport::statesForItem(quickItem());
|
||||
for (QObject *state : stateList)
|
||||
{
|
||||
if (state && nodeInstanceServer()->hasInstanceForObject(state))
|
||||
instanceList.append(nodeInstanceServer()->instanceForObject(state));
|
||||
@@ -596,7 +598,8 @@ Qt5NodeInstanceServer *QuickItemNodeInstance::qt5NodeInstanceServer() const
|
||||
|
||||
void QuickItemNodeInstance::updateDirtyNodesRecursive(QQuickItem *parentItem) const
|
||||
{
|
||||
foreach (QQuickItem *childItem, parentItem->childItems()) {
|
||||
const QList<QQuickItem *> childItems = parentItem->childItems();
|
||||
for (QQuickItem *childItem : childItems) {
|
||||
if (!nodeInstanceServer()->hasInstanceForObject(childItem))
|
||||
updateDirtyNodesRecursive(childItem);
|
||||
}
|
||||
@@ -704,7 +707,8 @@ QList<ServerNodeInstance> QuickItemNodeInstance::childItemsForChild(QQuickItem *
|
||||
QList<ServerNodeInstance> instanceList;
|
||||
|
||||
if (item) {
|
||||
foreach (QQuickItem *childItem, item->childItems())
|
||||
const QList<QQuickItem *> childItems = item->childItems();
|
||||
for (QQuickItem *childItem : childItems)
|
||||
{
|
||||
if (childItem && nodeInstanceServer()->hasInstanceForObject(childItem)) {
|
||||
instanceList.append(nodeInstanceServer()->instanceForObject(childItem));
|
||||
@@ -738,7 +742,8 @@ bool QuickItemNodeInstance::anyItemHasContent(QQuickItem *quickItem)
|
||||
if (quickItem->flags().testFlag(QQuickItem::ItemHasContents))
|
||||
return true;
|
||||
|
||||
foreach (QQuickItem *childItem, quickItem->childItems()) {
|
||||
const QList<QQuickItem *> childItems = quickItem->childItems();
|
||||
for (QQuickItem *childItem : childItems) {
|
||||
if (anyItemHasContent(childItem))
|
||||
return true;
|
||||
}
|
||||
@@ -748,7 +753,8 @@ bool QuickItemNodeInstance::anyItemHasContent(QQuickItem *quickItem)
|
||||
|
||||
bool QuickItemNodeInstance::childItemsHaveContent(QQuickItem *quickItem)
|
||||
{
|
||||
foreach (QQuickItem *childItem, quickItem->childItems()) {
|
||||
const QList<QQuickItem *> childItems = quickItem->childItems();
|
||||
for (QQuickItem *childItem : childItems) {
|
||||
if (anyItemHasContent(childItem))
|
||||
return true;
|
||||
}
|
||||
@@ -1003,7 +1009,8 @@ QPair<PropertyName, ServerNodeInstance> QuickItemNodeInstance::anchor(const Prop
|
||||
bool QuickItemNodeInstance::isAnchoredBySibling() const
|
||||
{
|
||||
if (quickItem()->parentItem()) {
|
||||
foreach (QQuickItem *siblingItem, quickItem()->parentItem()->childItems()) { // search in siblings for a anchor to this item
|
||||
const QList<QQuickItem *> childItems = quickItem()->parentItem()->childItems();
|
||||
for (QQuickItem *siblingItem : childItems) { // search in siblings for a anchor to this item
|
||||
if (siblingItem) {
|
||||
if (QQuickDesignerSupport::isAnchoredTo(siblingItem, quickItem()))
|
||||
return true;
|
||||
|
@@ -223,7 +223,7 @@ QVariant fixResourcePaths(const QVariant &value)
|
||||
const QString path = QLatin1String("qrc:") + url.path();
|
||||
if (!qmlDesignerRCPath().isEmpty()) {
|
||||
const QStringList searchPaths = qmlDesignerRCPath().split(QLatin1Char(';'));
|
||||
foreach (const QString &qrcPath, searchPaths) {
|
||||
for (const QString &qrcPath : searchPaths) {
|
||||
const QStringList qrcDefintion = qrcPath.split(QLatin1Char('='));
|
||||
if (qrcDefintion.count() == 2) {
|
||||
QString fixedPath = path;
|
||||
@@ -243,7 +243,7 @@ QVariant fixResourcePaths(const QVariant &value)
|
||||
if (str.contains(QLatin1String("qrc:"))) {
|
||||
if (!qmlDesignerRCPath().isEmpty()) {
|
||||
const QStringList searchPaths = qmlDesignerRCPath().split(QLatin1Char(';'));
|
||||
foreach (const QString &qrcPath, searchPaths) {
|
||||
for (const QString &qrcPath : searchPaths) {
|
||||
const QStringList qrcDefintion = qrcPath.split(QLatin1Char('='));
|
||||
if (qrcDefintion.count() == 2) {
|
||||
QString fixedPath = str;
|
||||
@@ -377,13 +377,14 @@ void doComponentCompleteRecursive(QObject *object, NodeInstanceServer *nodeInsta
|
||||
QList<QObject*> childList = object->children();
|
||||
|
||||
if (item) {
|
||||
foreach (QQuickItem *childItem, item->childItems()) {
|
||||
const QList<QQuickItem *> childItems = item->childItems();
|
||||
for (QQuickItem *childItem : childItems){
|
||||
if (!childList.contains(childItem))
|
||||
childList.append(childItem);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (QObject *child, childList) {
|
||||
for (QObject *child : std::as_const(childList)) {
|
||||
if (!nodeInstanceServer->hasInstanceForObject(child))
|
||||
doComponentCompleteRecursive(child, nodeInstanceServer);
|
||||
}
|
||||
@@ -583,7 +584,7 @@ QAbstractFileEngine *QrcEngineHandler::create(const QString &fileName) const
|
||||
|
||||
if (fileName.startsWith(":/")) {
|
||||
const QStringList searchPaths = qmlDesignerRCPath().split(';');
|
||||
foreach (const QString &qrcPath, searchPaths) {
|
||||
for (const QString &qrcPath : searchPaths) {
|
||||
const QStringList qrcDefintion = qrcPath.split('=');
|
||||
if (qrcDefintion.count() == 2) {
|
||||
QString fixedPath = fileName;
|
||||
|
Reference in New Issue
Block a user