diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-04-16 01:17:00 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-16 11:35:44 +0200 |
commit | 77fd8fd9977b987c99acba6417ac369a9975d989 (patch) | |
tree | 5b2b897d31c67a8bfee9641e59b728bc7f3ef2aa /src/corelib/kernel/qvariant.cpp | |
parent | d037d25c3d5236623371cf051aaf6a9e59792ba7 (diff) |
Show the type and address of QObjects in debug output.
Change-Id: I9f44ab80a6fb763adc9cbaf47de8e1b97212332d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.cpp')
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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<QObject*>(); +#endif +} #endif const QVariant::Handler qt_custom_variant_handler = { |