diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-06-20 14:44:48 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@digia.com> | 2014-07-15 13:06:38 +0200 |
commit | 87aceebf42af5bbc7ea96ac1a60a7ba030ad3e3f (patch) | |
tree | 042002979bd4571d435765388a09be8d1790fd8a /src/corelib/io/qdebug.h | |
parent | 45854c75aa0f090151f868ea3680c4b7490a3f4b (diff) |
QDebug: Add resetFormat()
Similar to QTextStream::reset(), this resets the stream format to the
defaults. Its primary use is inside custom operator<< implementations,
where you'd want to have a fixed format regardless of the current
stream state.
Change-Id: I421d76c61f164579bb90cf4195cc5376e2dcf0f3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/corelib/io/qdebug.h')
-rw-r--r-- | src/corelib/io/qdebug.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 0bbb617c1f..d224359724 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -93,6 +93,8 @@ public: ~QDebug(); inline void swap(QDebug &other) { qSwap(stream, other.stream); } + QDebug &resetFormat(); + inline QDebug &space() { stream->space = true; stream->ts << ' '; return *this; } inline QDebug &nospace() { stream->space = false; return *this; } inline QDebug &maybeSpace() { if (stream->space) stream->ts << ' '; return *this; } |