QmlDesigner: Add support for requesting types of frames

Change-Id: I3262887682520f521e84eacc26a6708d3d09b233
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2017-11-20 15:08:43 +01:00
parent f6068c9fd4
commit 76c1041dc9
2 changed files with 12 additions and 0 deletions

View File

@@ -54,6 +54,8 @@ public:
void setValue(const QVariant &value, qreal frame);
QVariant value(qreal frame) const;
TypeName valueType() const;
qreal currentFrame() const;
bool hasKeyframe(qreal frame);

View File

@@ -118,6 +118,16 @@ QVariant QmlTimelineFrames::value(qreal frame) const
return QVariant();
}
TypeName QmlTimelineFrames::valueType() const
{
const ModelNode targetNode = target();
if (targetNode.isValid() && targetNode.hasMetaInfo())
return targetNode.metaInfo().propertyTypeName(propertyName());
return TypeName();
}
bool QmlTimelineFrames::hasKeyframe(qreal frame)
{
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {