From 9d6d836871bc12d71683993efbe3da7444100f4c Mon Sep 17 00:00:00 2001 From: Mate Barany Date: Mon, 19 Sep 2022 17:36:10 +0200 Subject: [PATCH] QtWidgets: Use the default constructor of QString and append Addressing a comment from the review of QTBUG-98434: instead of the QL1S constructor use the default constructor and append "Path: "_L1. With the QL1S constructor capacity == size == rhs.capacity and the very next append is guaranteed to reallocate. In the other case the capacity will grow according to the growth strategy. Task-number: QTBUG-103100 Change-Id: Ifcc1c22a59739c6384b363471dbb27d6a978e306 Reviewed-by: Marc Mutz --- src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp index 16286e47bf8..d26669e0792 100644 --- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp @@ -575,7 +575,9 @@ QSimplexConstraint *GraphPath::constraint(const GraphPath &path) const #ifdef QT_DEBUG QString GraphPath::toString() const { - QString string("Path: "_L1); + QString string; + string += "Path: "_L1; + for (AnchorData *edge : positives) string += QString::fromLatin1(" (+++) %1").arg(edge->toString());