diff options
author | Ahmad Samir <[email protected]> | 2023-08-13 01:02:32 +0300 |
---|---|---|
committer | Ahmad Samir <[email protected]> | 2023-10-17 22:23:42 +0300 |
commit | 1097c21748362e2a53f2b050c170af5b7cb063b0 (patch) | |
tree | bf467b57c4fcfb2b27a93d34cf5ca34595e4ac12 | |
parent | 408799de65aaa4adcc6660c444f98bfb1a326dfe (diff) |
QGraphicsAnchorLayout: make a member container const
The m_edges container isn't changed after it's initialized in the
constructor; so make it const.
This amends commit 641bccce2a80b2a7268c3b8409bdc957b9a510b5.
Change-Id: I387eb2562475bc4910700d48f67303b0a5f80ccd
Reviewed-by: Christian Ehrlicher <[email protected]>
-rw-r--r-- | src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp | 4 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsanchorlayout_p.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp index 7b823b0cc18..174d95ad640 100644 --- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp @@ -459,7 +459,7 @@ void SequentialAnchorData::updateChildrenSizes() // "from" or "to", that _contains_ one of them. AnchorVertex *prev = from; - for (AnchorData *e : std::as_const(m_edges)) { + for (AnchorData *e : m_edges) { const bool edgeIsForward = (e->from == prev); if (edgeIsForward) { e->sizeAtMinimum = interpolate(minFactor, e->minSize, e->minPrefSize, @@ -494,7 +494,7 @@ void SequentialAnchorData::calculateSizeHints() AnchorVertex *prev = from; - for (AnchorData *edge : std::as_const(m_edges)) { + for (AnchorData *edge : m_edges) { const bool edgeIsForward = (edge->from == prev); if (edgeIsForward) { minSize += edge->minSize; diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h index 987d3847fda..96a408be380 100644 --- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h @@ -168,7 +168,7 @@ struct SequentialAnchorData : public AnchorData void calculateSizeHints(); QList<AnchorVertex *> m_children; // list of vertices in the sequence - QList<AnchorData *> m_edges; // keep the list of edges too. + const QList<AnchorData *> m_edges; // keep the list of edges too. }; struct ParallelAnchorData : public AnchorData |