summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2023-09-07 15:48:28 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-09-12 07:59:16 +0000
commit1d4d02e40d65502fd007c5da907e9f59906864fc (patch)
treebd22b32b417ec6951fea8d0cfbc0e0951db1ffdd
parentba75281542fbfcac2b25b02177bc01c4b92f4a8c (diff)
QPolygon(F): streamline the QDebug streaming operator
Just re-use the private functionality present elsewhere. As a drive-by fix this will also properly separate the individual points with commas, making the output readable again. Before: > QPolygonF(QPointF(0,0)QPointF(93.75,0)QPointF(93.75,62.5)QPointF(0,62.5)) After: > QPolygonF(QPointF(0,0), QPointF(93.75,0), QPointF(93.75,62.5), QPointF(0,62.5)) Change-Id: I0cf0408bfb2fe72974e4dbd5d2958c5a2aa56b5f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit c7486cd665e201dd48f49312681de4a776fbe558) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 170a2594f40c938f73241c7d3455fa80029b6b15)
-rw-r--r--src/gui/painting/qpolygon.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp
index a3a89d7504..7795e9dc5a 100644
--- a/src/gui/painting/qpolygon.cpp
+++ b/src/gui/painting/qpolygon.cpp
@@ -419,12 +419,7 @@ QRect QPolygon::boundingRect() const
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QPolygon &a)
{
- QDebugStateSaver saver(dbg);
- dbg.nospace() << "QPolygon(";
- for (int i = 0; i < a.size(); ++i)
- dbg.nospace() << a.at(i);
- dbg.nospace() << ')';
- return dbg;
+ return QtPrivate::printSequentialContainer(dbg, "QPolygon", a);
}
#endif
@@ -740,12 +735,7 @@ QDataStream &operator>>(QDataStream &s, QPolygonF &a)
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QPolygonF &a)
{
- QDebugStateSaver saver(dbg);
- dbg.nospace() << "QPolygonF(";
- for (int i = 0; i < a.size(); ++i)
- dbg.nospace() << a.at(i);
- dbg.nospace() << ')';
- return dbg;
+ return QtPrivate::printSequentialContainer(dbg, "QPolygonF", a);
}
#endif