From 77fd8fd9977b987c99acba6417ac369a9975d989 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 16 Apr 2012 01:17:00 +0200 Subject: Show the type and address of QObjects in debug output. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9f44ab80a6fb763adc9cbaf47de8e1b97212332d Reviewed-by: Jędrzej Nowacki --- src/corelib/kernel/qvariant.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/corelib/kernel/qvariant.cpp') diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 654170fabb..82e0435d0a 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -834,7 +834,13 @@ static bool customConvert(const QVariant::Private *, int, void *, bool *ok) } #if !defined(QT_NO_DEBUG_STREAM) -static void customStreamDebug(QDebug, const QVariant &) {} +static void customStreamDebug(QDebug dbg, const QVariant &variant) { +#ifndef QT_BOOTSTRAPPED + QMetaType::TypeFlags flags = QMetaType::typeFlags(variant.userType()); + if (flags & QMetaType::PointerToQObject) + dbg.nospace() << variant.value(); +#endif +} #endif const QVariant::Handler qt_custom_variant_handler = { -- cgit v1.2.3