From f53621af053f313eff7fa7b204b5cceff675cb64 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 31 Mar 2015 15:49:08 +0200 Subject: 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 --- src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp') 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] -- cgit v1.2.3