QmlDesigner: Add NodeInstanceServer::allGroupStateInstances()

Change-Id: I26b20976746c3790d679a63db209fb535eb58382
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Thomas Hartmann
2022-08-23 17:32:48 +02:00
parent 80922268ab
commit 8e65e2815c
2 changed files with 17 additions and 0 deletions

View File

@@ -1061,6 +1061,21 @@ ServerNodeInstance NodeInstanceServer::rootNodeInstance() const
return m_rootNodeInstance;
}
QList<ServerNodeInstance> NodeInstanceServer::allGroupStateInstances() const
{
QList<ServerNodeInstance> groups;
std::copy_if(nodeInstances().cbegin(),
nodeInstances().cend(),
std::back_inserter(groups),
[](const ServerNodeInstance &instance) {
return instance.isValid() && instance.internalObject()->metaObject()
&& instance.internalObject()->metaObject()->className()
== QByteArrayLiteral("QQuickStateGroup");
});
return groups;
}
void NodeInstanceServer::setStateInstance(const ServerNodeInstance &stateInstance)
{
m_activeStateInstance = stateInstance;

View File

@@ -200,6 +200,8 @@ public:
ServerNodeInstance rootNodeInstance() const;
QList<ServerNodeInstance> allGroupStateInstances() const;
void notifyPropertyChange(qint32 instanceid, const PropertyName &propertyName);
QByteArray importCode() const;