summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpolygon.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-03-30 14:24:21 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-03-30 12:59:58 +0000
commit3203ac3f4e245427902bd912cb0c644c7e870657 (patch)
tree9c5bf3dc0b22d59bc683a5cbccadc2a82e27644b /src/gui/painting/qpolygon.cpp
parentc7b003ea3b8b4b7124d4971df7d910f2bc3fc4fa (diff)
Use QDebugStateSaver to restore space setting in stream operators.
Returning dbg.space() breaks formatting on streams that already have nospace() set. Change-Id: I55e38b018679a67eb40be6b4664505483a3a7d8e Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/gui/painting/qpolygon.cpp')
-rw-r--r--src/gui/painting/qpolygon.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp
index 511af49787..efcc8875a5 100644
--- a/src/gui/painting/qpolygon.cpp
+++ b/src/gui/painting/qpolygon.cpp
@@ -461,11 +461,12 @@ 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.count(); ++i)
dbg.nospace() << a.at(i);
dbg.nospace() << ')';
- return dbg.space();
+ return dbg;
}
#endif
@@ -802,11 +803,12 @@ 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.count(); ++i)
dbg.nospace() << a.at(i);
dbg.nospace() << ')';
- return dbg.space();
+ return dbg;
}
#endif