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>
This commit is contained in:
Mate Barany 2022-09-19 17:36:10 +02:00
parent df0b70eece
commit 9d6d836871

View File

@ -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());