diff options
author | David Faure <faure@kde.org> | 2012-07-27 14:17:38 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-14 23:44:15 +0100 |
commit | 327b2ba3b77e7a738ccfbe84c6ca5e9525010630 (patch) | |
tree | f89c8299d94d4f407ddb91bc4dfff3464680a85e /src/corelib/io/qdebug.h | |
parent | ad265c55beb596e28d6b28c16700795fa8555ee6 (diff) |
Add class QDebugStateSaver for writing QDebug operators correctly
Had to move QTextStreamPrivate to a private header, to be able to use
its new internal Params struct from qdebug.cpp
Change-Id: If28e25f27bbd04b1825a5eb3e2ef83ecad72e7b2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdebug.h')
-rw-r--r-- | src/corelib/io/qdebug.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 4c8f961ed8..9618dd5a2f 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -61,6 +61,7 @@ QT_BEGIN_NAMESPACE class Q_CORE_EXPORT QDebug { friend class QMessageLogger; + friend class QDebugStateSaverPrivate; struct Stream { Stream(QIODevice *device) : ts(device), ref(1), type(QtDebugMsg), space(true), message_output(false) {} Stream(QString *string) : ts(string, QIODevice::WriteOnly), ref(1), type(QtDebugMsg), space(true), message_output(false) {} @@ -132,6 +133,17 @@ public: Q_DECLARE_SHARED(QDebug) +class QDebugStateSaverPrivate; +class Q_CORE_EXPORT QDebugStateSaver +{ +public: + QDebugStateSaver(QDebug &dbg); + ~QDebugStateSaver(); +private: + Q_DISABLE_COPY(QDebugStateSaver) + QScopedPointer<QDebugStateSaverPrivate> d; +}; + class QNoDebug { public: |