diff --git a/src/plugins/qmldesigner/components/debugview/debugview.cpp b/src/plugins/qmldesigner/components/debugview/debugview.cpp index 86899d4373c..3c3147b56c1 100644 --- a/src/plugins/qmldesigner/components/debugview/debugview.cpp +++ b/src/plugins/qmldesigner/components/debugview/debugview.cpp @@ -313,11 +313,12 @@ void DebugView::selectedNodesChanged(const QList &selectedNodes /*sel } auto auxiliaryData = selectedNode.auxiliaryData(); + AuxiliaryDatas sortedaAuxiliaryData{auxiliaryData.begin(), auxiliaryData.end()}; - Utils::sort(auxiliaryData, [](const auto &first, const auto &second) { + Utils::sort(sortedaAuxiliaryData, [](const auto &first, const auto &second) { return first.first < second.first; }); - for (const auto &element : auxiliaryData) { + for (const auto &element : sortedaAuxiliaryData) { message << element.first.type << ' ' << element.first.name.data() << ' ' << element.second.toString() << lineBreak; } diff --git a/src/plugins/qmldesigner/designercore/include/auxiliarydata.h b/src/plugins/qmldesigner/designercore/include/auxiliarydata.h index 7c45d547600..176144062d2 100644 --- a/src/plugins/qmldesigner/designercore/include/auxiliarydata.h +++ b/src/plugins/qmldesigner/designercore/include/auxiliarydata.h @@ -28,6 +28,7 @@ #include #include +#include #include @@ -75,5 +76,6 @@ bool operator!=(const BasicAuxiliaryDataKey &first, const BasicAuxiliaryD using AuxiliaryDataKey = BasicAuxiliaryDataKey; using AuxiliaryDataKeyView = BasicAuxiliaryDataKey; using AuxiliaryDatas = std::vector>; +using AuxiliaryDatasView = Utils::span>; using AuxiliaryDatasForType = std::vector>; } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/include/modelnode.h b/src/plugins/qmldesigner/designercore/include/modelnode.h index c46cdd8f208..22b2afc1a62 100644 --- a/src/plugins/qmldesigner/designercore/include/modelnode.h +++ b/src/plugins/qmldesigner/designercore/include/modelnode.h @@ -214,7 +214,7 @@ public: bool hasAuxiliaryData(AuxiliaryDataKeyView key) const; bool hasAuxiliaryData(AuxiliaryDataType type, Utils::SmallStringView name) const; AuxiliaryDatasForType auxiliaryData(AuxiliaryDataType type) const; - const AuxiliaryDatas &auxiliaryData() const; + AuxiliaryDatasView auxiliaryData() const; QString customId() const; bool hasCustomId() const; diff --git a/src/plugins/qmldesigner/designercore/model/internalnode_p.h b/src/plugins/qmldesigner/designercore/model/internalnode_p.h index a0ec885aefd..19f039c406f 100644 --- a/src/plugins/qmldesigner/designercore/model/internalnode_p.h +++ b/src/plugins/qmldesigner/designercore/model/internalnode_p.h @@ -87,7 +87,7 @@ public: bool removeAuxiliaryData(AuxiliaryDataKeyView key); bool hasAuxiliaryData(AuxiliaryDataKeyView key) const; AuxiliaryDatasForType auxiliaryData(AuxiliaryDataType type) const; - const AuxiliaryDatas &auxiliaryData() const { return m_auxiliaryDatas; } + AuxiliaryDatasView auxiliaryData() const { return std::as_const(m_auxiliaryDatas); } InternalProperty::Pointer property(const PropertyName &name) const; InternalBindingProperty::Pointer bindingProperty(const PropertyName &name) const; diff --git a/src/plugins/qmldesigner/designercore/model/modelnode.cpp b/src/plugins/qmldesigner/designercore/model/modelnode.cpp index 29c48d4e3ba..9e1ab497eb3 100644 --- a/src/plugins/qmldesigner/designercore/model/modelnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/modelnode.cpp @@ -1136,7 +1136,7 @@ AuxiliaryDatasForType ModelNode::auxiliaryData(AuxiliaryDataType type) const return m_internalNode->auxiliaryData(type); } -const AuxiliaryDatas &ModelNode::auxiliaryData() const +AuxiliaryDatasView ModelNode::auxiliaryData() const { if (!isValid()) throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);