diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2017-01-06 22:02:50 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2017-01-12 17:54:28 +0000 |
commit | dcec1420ea9d7e90bbd7f37be15d8e61eaf35d23 (patch) | |
tree | 950020aadfc183963a5668263ef302d8d6b0e6de /src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp | |
parent | 8f469e4a19feb77758fb5d3c7120ba93cf32cd7d (diff) |
Use QString::asprintf(), QStringBuilder, and the multi-arg overload of QString::arg()
... instead of sequential .arg(const QString &) callings.
It saves memory allocations and prevents unexpected results
if replacing strings contain place markers.
Found with clazy's qstring-arg check.
Change-Id: I3912275a6e11c6fb7559ff5623f2e8cde9b7f07a
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp index 6a9036997c..60e9039b4a 100644 --- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp @@ -892,7 +892,7 @@ bool QGraphicsAnchorLayoutPrivate::replaceVertex(Orientation orientation, Anchor AnchorVertex *otherV = replaceVertex_helper(ad, oldV, newV); #if defined(QT_DEBUG) - ad->name = QString::fromLatin1("%1 --to--> %2").arg(ad->from->toString()).arg(ad->to->toString()); + ad->name = QString::fromLatin1("%1 --to--> %2").arg(ad->from->toString(), ad->to->toString()); #endif bool newFeasible; @@ -1755,7 +1755,7 @@ void QGraphicsAnchorLayoutPrivate::addAnchor_helper(QGraphicsLayoutItem *firstIt data->from = v1; data->to = v2; #ifdef QT_DEBUG - data->name = QString::fromLatin1("%1 --to--> %2").arg(v1->toString()).arg(v2->toString()); + data->name = QString::fromLatin1("%1 --to--> %2").arg(v1->toString(), v2->toString()); #endif // ### bit to track internal anchors, since inside AnchorData methods // we don't have access to the 'q' pointer. |