From 46bcbf0921520fcc0b10116b82df0aebf0097714 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 10 Jan 2020 13:25:00 +0100 Subject: Return false for user types in isSaveable() When calling isSaveable() for a user based type then it should return false because the client will not be able to read these types. This prevents it from using the wrong streaming operator for the user types then. Change-Id: I7f3bff359dd0c3fa49dc4e83db0057b79c481ed9 Reviewed-by: Ulf Hermann --- src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp index 029004ffd1..bdcbf0023a 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp @@ -94,9 +94,12 @@ qint64 NullDevice::writeData(const char *data, qint64 len) // (otherwise we assert in QVariant::operator<< when actually saving it) static bool isSaveable(const QVariant &value) { + const int valType = static_cast(value.type()); + if (valType >= QMetaType::User) + return false; NullDevice nullDevice; QDataStream fakeStream(&nullDevice); - return QMetaType::save(fakeStream, static_cast(value.type()), value.constData()); + return QMetaType::save(fakeStream, valType, value.constData()); } QQmlEngineDebugServiceImpl::QQmlEngineDebugServiceImpl(QObject *parent) : -- cgit v1.2.3