summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMate Barany <mate.barany@qt.io>2022-09-19 17:36:10 +0200
committerMate Barany <mate.barany@qt.io>2022-09-27 20:38:13 +0200
commit9d6d836871bc12d71683993efbe3da7444100f4c (patch)
tree382c486b8dc22961034317e0868cf25ae79a18e8
parentdf0b70eece519b1c78353588ba92ef39d873aa1f (diff)
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 <marc.mutz@qt.io>
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
index 16286e47bf..d26669e079 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());