Skip to content
Snippets Groups Projects
Commit a0f17e00 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner.NodeInstances: Fix supported type because of qvariant changes


Change-Id: Iec63a16218420e546e612909380dcd4f5bdb4a30
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent c818858a
Branches
Tags
No related merge requests found
...@@ -964,9 +964,9 @@ InformationChangedCommand NodeInstanceServer::createAllInformationChangedCommand ...@@ -964,9 +964,9 @@ InformationChangedCommand NodeInstanceServer::createAllInformationChangedCommand
return InformationChangedCommand(createInformationVector(instanceList, initial)); return InformationChangedCommand(createInformationVector(instanceList, initial));
} }
static bool supportedVariantType(QVariant::Type type) static bool supportedVariantType(int type)
{ {
return type < QVariant::UserType && type != QVariant::Icon; return type < QVariant::LastCoreType && type != QMetaType::QObjectStar;
} }
ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QList<ServerNodeInstance> &instanceList) const ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QList<ServerNodeInstance> &instanceList) const
...@@ -976,7 +976,7 @@ ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QList< ...@@ -976,7 +976,7 @@ ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QList<
foreach (const ServerNodeInstance &instance, instanceList) { foreach (const ServerNodeInstance &instance, instanceList) {
foreach (const QString &propertyName, instance.propertyNames()) { foreach (const QString &propertyName, instance.propertyNames()) {
QVariant propertyValue = instance.property(propertyName); QVariant propertyValue = instance.property(propertyName);
if (supportedVariantType(propertyValue.type())) if (supportedVariantType(propertyValue.userType()))
valueVector.append(PropertyValueContainer(instance.instanceId(), propertyName, propertyValue, QString())); valueVector.append(PropertyValueContainer(instance.instanceId(), propertyName, propertyValue, QString()));
} }
} }
...@@ -1005,10 +1005,11 @@ ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QVecto ...@@ -1005,10 +1005,11 @@ ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QVecto
if ( instance.isValid()) { if ( instance.isValid()) {
QVariant propertyValue = instance.property(propertyName); QVariant propertyValue = instance.property(propertyName);
if (supportedVariantType(propertyValue.type())) if (QMetaType::isRegistered(propertyValue.userType()) && supportedVariantType(propertyValue.type())) {
valueVector.append(PropertyValueContainer(instance.instanceId(), propertyName, propertyValue, QString())); valueVector.append(PropertyValueContainer(instance.instanceId(), propertyName, propertyValue, QString()));
} }
} }
}
return ValuesChangedCommand(valueVector); return ValuesChangedCommand(valueVector);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment