QmlDesigner: Move QmlVisualNode::states to QmlObjectNode

This is required for StateGroup support.

Change-Id: I25d8f94c2a0fa9140ce8af3032bc92a7b858b9d8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
Thomas Hartmann
2022-08-22 17:10:00 +02:00
parent bddac59a95
commit f4c6bf0179
4 changed files with 10 additions and 10 deletions

View File

@@ -131,6 +131,8 @@ public:
QList<QmlModelState> allDefinedStates() const;
QList<QmlModelStateOperation> allInvalidStateOperations() const;
QmlModelStateGroup states() const;
protected:
NodeInstance nodeInstance() const;
QmlObjectNode nodeForInstance(const NodeInstance &instance) const;

View File

@@ -71,7 +71,6 @@ public:
static bool isValidQmlVisualNode(const ModelNode &modelNode);
bool isRootNode() const;
QmlModelStateGroup states() const;
QList<QmlVisualNode> children() const;
QList<QmlObjectNode> resources() const;
QList<QmlObjectNode> allDirectSubNodes() const;
@@ -121,7 +120,7 @@ private:
class QMLDESIGNERCORE_EXPORT QmlModelStateGroup
{
friend class QmlVisualNode;
friend class QmlObjectNode;
friend class StatesEditorView;
public:

View File

@@ -582,6 +582,13 @@ QList<QmlModelStateOperation> QmlObjectNode::allInvalidStateOperations() const
return result;
}
QmlModelStateGroup QmlObjectNode::states() const
{
if (isValid())
return QmlModelStateGroup(modelNode());
else
return QmlModelStateGroup();
}
/*!
Removes a variant property of the object specified by \a name from the

View File

@@ -191,14 +191,6 @@ void QmlVisualNode::initializePosition(const QmlVisualNode::Position &position)
}
}
QmlModelStateGroup QmlVisualNode::states() const
{
if (isValid())
return QmlModelStateGroup(modelNode());
else
return QmlModelStateGroup();
}
QmlObjectNode QmlVisualNode::createQmlObjectNode(AbstractView *view,
const ItemLibraryEntry &itemLibraryEntry,
const Position &position,