From aff03cbc276357b4db412ec8f8368e723f2a6277 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 7 Jun 2013 12:00:53 +0200 Subject: [PATCH] Don't convert built-in types to strings for qDebug. This was introduced by 7ed15da3 (Core: QDebug and comparison operator support metatypes,, 2013-03-20). Change-Id: Id89aaffeee8d519ca73f0b52b1ac8b9d233cb5f1 Reviewed-by: Christoph Schleifenbaum Reviewed-by: Stephen Kelly --- src/corelib/kernel/qvariant.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 274a86591b..a9e7549685 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -3163,9 +3163,11 @@ QDebug operator<<(QDebug dbg, const QVariant &v) if (typeId != QMetaType::UnknownType) { dbg.nospace() << QMetaType::typeName(typeId) << ", "; bool userStream = false; - if (typeId >= QMetaType::User) + bool canConvertToString = false; + if (typeId >= QMetaType::User) { userStream = QMetaType::debugStream(dbg, constData(v.d), typeId); - bool canConvertToString = v.canConvert(); + canConvertToString = v.canConvert(); + } if (!userStream && canConvertToString) dbg << v.toString(); else if (!userStream)