summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp3
-rw-r--r--src/corelib/kernel/qppsattribute.cpp3
-rw-r--r--src/corelib/kernel/qtimerinfo_unix.cpp4
-rw-r--r--src/corelib/kernel/qvariant.cpp12
4 files changed, 14 insertions, 8 deletions
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index 424ee3fdea..dfb358202d 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -1041,8 +1041,9 @@ QString decodeMSG(const MSG& msg)
QDebug operator<<(QDebug dbg, const MSG &msg)
{
+ QDebugStateSaver saver(dbg);
dbg << decodeMSG(msg);
- return dbg.nospace();
+ return dbg;
}
#endif
diff --git a/src/corelib/kernel/qppsattribute.cpp b/src/corelib/kernel/qppsattribute.cpp
index 09d8d1bb0c..f4c067e35a 100644
--- a/src/corelib/kernel/qppsattribute.cpp
+++ b/src/corelib/kernel/qppsattribute.cpp
@@ -260,7 +260,8 @@ QVariant QPpsAttribute::toVariant() const
QDebug operator<<(QDebug dbg, const QPpsAttribute &attribute)
{
- dbg << "QPpsAttribute(";
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "QPpsAttribute(";
switch (attribute.type()) {
case QPpsAttribute::Number:
diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp
index 43674f2c9c..f4a42acb59 100644
--- a/src/corelib/kernel/qtimerinfo_unix.cpp
+++ b/src/corelib/kernel/qtimerinfo_unix.cpp
@@ -207,11 +207,13 @@ static timespec roundToMillisecond(timespec val)
#ifdef QTIMERINFO_DEBUG
QDebug operator<<(QDebug s, timeval tv)
{
+ QDebugStateSaver saver(s);
s.nospace() << tv.tv_sec << "." << qSetFieldWidth(6) << qSetPadChar(QChar(48)) << tv.tv_usec << reset;
- return s.space();
+ return s;
}
QDebug operator<<(QDebug s, Qt::TimerType t)
{
+ QDebugStateSaver saver(s);
s << (t == Qt::PreciseTimer ? "P" :
t == Qt::CoarseTimer ? "C" : "VC");
return s;
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index df1b4ed872..9e61813e20 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -3424,10 +3424,11 @@ bool QVariant::isNull() const
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QVariant &v)
{
+ QDebugStateSaver saver(dbg);
const uint typeId = v.d.type;
dbg.nospace() << "QVariant(";
if (typeId != QMetaType::UnknownType) {
- dbg.nospace() << QMetaType::typeName(typeId) << ", ";
+ dbg << QMetaType::typeName(typeId) << ", ";
bool userStream = false;
bool canConvertToString = false;
if (typeId >= QMetaType::User) {
@@ -3439,19 +3440,20 @@ QDebug operator<<(QDebug dbg, const QVariant &v)
else if (!userStream)
handlerManager[typeId]->debugStream(dbg, v);
} else {
- dbg.nospace() << "Invalid";
+ dbg << "Invalid";
}
- dbg.nospace() << ')';
- return dbg.space();
+ dbg << ')';
+ return dbg;
}
QDebug operator<<(QDebug dbg, const QVariant::Type p)
{
+ QDebugStateSaver saver(dbg);
dbg.nospace() << "QVariant::"
<< (int(p) != int(QMetaType::UnknownType)
? QMetaType::typeName(p)
: "Invalid");
- return dbg.space();
+ return dbg;
}
#endif