summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdebug.h
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-07-27 14:17:38 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-14 23:44:15 +0100
commit327b2ba3b77e7a738ccfbe84c6ca5e9525010630 (patch)
treef89c8299d94d4f407ddb91bc4dfff3464680a85e /src/corelib/io/qdebug.h
parentad265c55beb596e28d6b28c16700795fa8555ee6 (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.h12
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: