summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-03-31 15:49:08 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-04-01 04:28:08 +0000
commitf53621af053f313eff7fa7b204b5cceff675cb64 (patch)
treef1f49abf2a7494c028fadda9eb36f0e40794692f /src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp
parent7c2360b762817743484ddc5bc9ba3f48a7b68d84 (diff)
Update documentation snippets related to QDebug.
Use QDebugStateSaver to store the formatting state and fix the return statement to return the unmodified stream. Change-Id: I476d13c5487a89f263dcc11334fc67c85d9433f5 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp')
-rw-r--r--src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp b/src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp
index f71d61ed47..a9ab83f5bf 100644
--- a/src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp
+++ b/src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp
@@ -51,11 +51,12 @@ public:
};
//! [0]
-QDebug operator<<(QDebug dbg, const Coordinate &c)
+QDebug operator<<(QDebug debug, const Coordinate &c)
{
- dbg.nospace() << "(" << c.x() << ", " << c.y() << ")";
+ QDebugStateSaver saver(debug);
+ debug.nospace() << '(' << c.x() << ", " << c.y() << ')';
- return dbg.space();
+ return debug;
}
//! [0]