forked from qt-creator/qt-creator
QmlDesigner: Add allTimelines
This makes it easy to retrieve all existing timelines. Change-Id: I61fdacce28ea7c8afe48da81b87c8b47ee1cec26 Reviewed-by: Henning Gründl <henning.gruendl@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -138,6 +138,8 @@ public:
|
|||||||
|
|
||||||
QmlModelStateGroup states() const;
|
QmlModelStateGroup states() const;
|
||||||
|
|
||||||
|
QList<ModelNode> allTimelines() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
NodeInstance nodeInstance() const;
|
NodeInstance nodeInstance() const;
|
||||||
QmlObjectNode nodeForInstance(const NodeInstance &instance) const;
|
QmlObjectNode nodeForInstance(const NodeInstance &instance) const;
|
||||||
|
@@ -590,6 +590,18 @@ QmlModelStateGroup QmlObjectNode::states() const
|
|||||||
return QmlModelStateGroup();
|
return QmlModelStateGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<ModelNode> QmlObjectNode::allTimelines() const
|
||||||
|
{
|
||||||
|
QList<ModelNode> timelineNodes;
|
||||||
|
const auto allNodes = view()->allModelNodes();
|
||||||
|
for (const auto &timelineNode : allNodes) {
|
||||||
|
if (QmlTimeline::isValidQmlTimeline(timelineNode))
|
||||||
|
timelineNodes.append(timelineNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
return timelineNodes;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Removes a variant property of the object specified by \a name from the
|
Removes a variant property of the object specified by \a name from the
|
||||||
model.
|
model.
|
||||||
|
Reference in New Issue
Block a user