diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp index d2cf7dc57f..cbce99956d 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp @@ -209,19 +209,30 @@ QVariant QQmlEngineDebugServiceImpl::valueContents(QVariant value) const } if (QQmlValueTypeFactory::isValueType(userType)) { + switch (userType) { + case QMetaType::QRect: + case QMetaType::QRectF: + case QMetaType::QPoint: + case QMetaType::QPointF: + case QMetaType::QFont: + // Don't call the toString() method on those. The stream operators are better. + return value; + default: + break; + } + const QMetaObject *mo = QQmlValueTypeFactory::metaObjectForMetaType(userType); if (mo) { - int toStringIndex = mo->indexOfMethod("toString"); + int toStringIndex = mo->indexOfMethod("toString()"); if (toStringIndex != -1) { QMetaMethod mm = mo->method(toStringIndex); - QMetaType info(userType); QString s; - if (info.flags() & QMetaType::IsGadget - && mm.invokeOnGadget(value.data(), Q_RETURN_ARG(QString, s))) + if (mm.invokeOnGadget(value.data(), Q_RETURN_ARG(QString, s))) return s; } } + // We expect all QML value types to either have a toString() method or stream operators return value; } |