summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2014-10-23 17:26:29 +0200
committerKai Koehne <kai.koehne@theqtcompany.com>2014-10-24 16:17:58 +0200
commit6e1718987e0f781bfd4f7036cc404f762c2301a8 (patch)
tree15efdcc21d28e40576e880cc6f5f2e256b0f4969 /src/corelib
parent89ae5c03a21f15b5f2abad23c6963c15772600eb (diff)
QObject: use QDebugStateSaver in the QDebug operator<<
Also remove the ending space if the object is null Change-Id: Ieb2bb903de35b4e339c812cd07555b5d108d118b Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qobject.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index d153b2e4f9..223de0c8e0 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -4093,14 +4093,16 @@ QObjectUserData* QObject::userData(uint id) const
#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const QObject *o) {
+QDebug operator<<(QDebug dbg, const QObject *o)
+{
+ QDebugStateSaver saver(dbg);
if (!o)
- return dbg << "QObject(0x0) ";
+ return dbg << "QObject(0x0)";
dbg.nospace() << o->metaObject()->className() << '(' << (void *)o;
if (!o->objectName().isEmpty())
dbg << ", name = " << o->objectName();
dbg << ')';
- return dbg.space();
+ return dbg;
}
#endif