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 <christoph.schleifenbaum@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
parent
8fbf959bee
commit
aff03cbc27
@ -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<QString>();
|
||||
canConvertToString = v.canConvert<QString>();
|
||||
}
|
||||
if (!userStream && canConvertToString)
|
||||
dbg << v.toString();
|
||||
else if (!userStream)
|
||||
|
Loading…
Reference in New Issue
Block a user