From c471b5a3eaf784b73187173c3732c3a3ca16c9c5 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 26 Apr 2021 11:17:38 +0200 Subject: [PATCH] QmlDesigner: Change NodeListPropertyIterator::difference_type to qsizetype Should fixes Qt5 <-> Qt6 differences. Amends I743f942fb0bef9f907b4facbb346264dfeaad778 Change-Id: I7545936e6c5b725cedd0606039008f0c5bdbfdd2 Reviewed-by: Tim Jenssen --- .../designercore/include/nodelistproperty.h | 10 +++++----- .../designercore/model/nodelistproperty.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/include/nodelistproperty.h b/src/plugins/qmldesigner/designercore/include/nodelistproperty.h index fa46635b97e..8bc8590cc33 100644 --- a/src/plugins/qmldesigner/designercore/include/nodelistproperty.h +++ b/src/plugins/qmldesigner/designercore/include/nodelistproperty.h @@ -46,13 +46,13 @@ class NodeListPropertyIterator public: using iterator_category = std::random_access_iterator_tag; - using difference_type = int; + using difference_type = qsizetype; using value_type = ModelNode; using pointer = InternalNodeListPropertyPointer; using reference = ModelNode; NodeListPropertyIterator() = default; - NodeListPropertyIterator(int currentIndex, + NodeListPropertyIterator(difference_type currentIndex, class InternalNodeListProperty *nodeListProperty, Model *model, AbstractView *view) @@ -68,7 +68,7 @@ public: return *this; } - NodeListPropertyIterator operator++(difference_type) + NodeListPropertyIterator operator++(int) { auto tmp = *this; ++m_currentIndex; @@ -81,7 +81,7 @@ public: return *this; } - NodeListPropertyIterator operator--(difference_type) + NodeListPropertyIterator operator--(int) { auto tmp = *this; --m_currentIndex; @@ -168,7 +168,7 @@ private: InternalNodeListProperty *m_nodeListProperty{}; Model *m_model{}; AbstractView *m_view{}; - int m_currentIndex = -1; + difference_type m_currentIndex = -1; }; } // namespace Internal diff --git a/src/plugins/qmldesigner/designercore/model/nodelistproperty.cpp b/src/plugins/qmldesigner/designercore/model/nodelistproperty.cpp index 5f475cfd397..512f37722a9 100644 --- a/src/plugins/qmldesigner/designercore/model/nodelistproperty.cpp +++ b/src/plugins/qmldesigner/designercore/model/nodelistproperty.cpp @@ -177,7 +177,7 @@ NodeListProperty::iterator NodeListProperty::rotate(NodeListProperty::iterator f privateModel()->notifyNodeOrderChanged(m_internalNodeListProperty); - return {int(iter - begin), internalNodeListProperty().data(), model(), view()}; + return {iter - begin, internalNodeListProperty().data(), model(), view()}; } void NodeListProperty::reverse(NodeListProperty::iterator first, NodeListProperty::iterator last)