aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2020-01-10 13:25:00 +0100
committerAndy Shaw <andy.shaw@qt.io>2020-01-10 16:02:25 +0100
commit46bcbf0921520fcc0b10116b82df0aebf0097714 (patch)
tree2c9d3e3713683d2a7a8c137f3fb1c3e604928bbc /src/plugins
parent2d566bb65def5b759bb4d93d767c4377bc6c5e0a (diff)
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 <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp5
1 files changed, 4 insertions, 1 deletions
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<int>(value.type());
+ if (valType >= QMetaType::User)
+ return false;
NullDevice nullDevice;
QDataStream fakeStream(&nullDevice);
- return QMetaType::save(fakeStream, static_cast<int>(value.type()), value.constData());
+ return QMetaType::save(fakeStream, valType, value.constData());
}
QQmlEngineDebugServiceImpl::QQmlEngineDebugServiceImpl(QObject *parent) :