summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdebug.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-02-23 10:06:48 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-03-13 13:24:36 +0000
commit3994ea1979249e0bf76eb38c89ff3d3dfb1d90b5 (patch)
tree8abe0184585c05905e3fb9a247ff58e5c775dbb9 /src/corelib/io/qdebug.cpp
parentd2f418e98f81da5130a69e6662a3968e63e5f077 (diff)
Add a verbosity setting to QDebug.
Add setters for an int verbosity to QDebug. The streaming operators can check on the setting and output more information accordingly. [ChangeLog][QtCore][QDebug] How verbose a single debug output should be can now be fine-tuned by setting a verbosity on the debug stream. Change-Id: I77001fcf1ef090a580d1a137bb5a667fc1bf1e1b Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/corelib/io/qdebug.cpp')
-rw-r--r--src/corelib/io/qdebug.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index 357d63137c..8676fe0259 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -334,6 +334,7 @@ QDebug &QDebug::resetFormat()
stream->space = true;
if (stream->context.version > 1)
stream->flags = 0;
+ stream->setVerbosity(Stream::defaultVerbosity);
return *this;
}
@@ -424,6 +425,32 @@ QDebug &QDebug::resetFormat()
*/
/*!
+ \fn int QDebug::verbosity() const
+ \since 5.6
+
+ Returns the verbosity of the debug stream.
+
+ Streaming operators can check the value to decide whether
+ verbose output is desired and print more information depending on the
+ level. Higher values indicate that more information is desired.
+
+ The allowed range is from 0 to 7. The default value is 2.
+
+ \sa setVerbosity()
+*/
+
+/*!
+ \fn void QDebug::setVerbosity(int verbosityLevel)
+ \since 5.6
+
+ Sets the verbosity of the stream to \a verbosityLevel.
+
+ The allowed range is from 0 to 7. The default value is 2.
+
+ \sa verbosity()
+*/
+
+/*!
\fn QDebug &QDebug::operator<<(QChar t)
Writes the character, \a t, to the stream and returns a reference to the