forked from qt-creator/qt-creator
QmlDesigner: Add removeKeyframesForTargetAndProperty
This allows to remove keyframe groups for a specific property. This is required if a dynamic property is removed. Change-Id: Ic3a2609241df21d81954ab18e4aeec1c47bfe336 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:
@@ -65,6 +65,10 @@ public:
|
|||||||
QList<ModelNode> allTargets() const;
|
QList<ModelNode> allTargets() const;
|
||||||
QList<QmlTimelineKeyframeGroup> keyframeGroupsForTarget(const ModelNode &target) const;
|
QList<QmlTimelineKeyframeGroup> keyframeGroupsForTarget(const ModelNode &target) const;
|
||||||
void destroyKeyframesForTarget(const ModelNode &target);
|
void destroyKeyframesForTarget(const ModelNode &target);
|
||||||
|
|
||||||
|
void removeKeyframesForTargetAndProperty(const ModelNode &target,
|
||||||
|
const PropertyName &propertyName);
|
||||||
|
|
||||||
static bool hasActiveTimeline(AbstractView *view);
|
static bool hasActiveTimeline(AbstractView *view);
|
||||||
|
|
||||||
bool isRecording() const;
|
bool isRecording() const;
|
||||||
|
@@ -208,6 +208,15 @@ void QmlTimeline::destroyKeyframesForTarget(const ModelNode &target)
|
|||||||
frames.destroy();
|
frames.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmlTimeline::removeKeyframesForTargetAndProperty(const ModelNode &target,
|
||||||
|
const PropertyName &propertyName)
|
||||||
|
{
|
||||||
|
for (QmlTimelineKeyframeGroup frames : keyframeGroupsForTarget(target)) {
|
||||||
|
if (frames.propertyName() == propertyName)
|
||||||
|
frames.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool QmlTimeline::hasActiveTimeline(AbstractView *view)
|
bool QmlTimeline::hasActiveTimeline(AbstractView *view)
|
||||||
{
|
{
|
||||||
if (view && view->isAttached()) {
|
if (view && view->isAttached()) {
|
||||||
|
Reference in New Issue
Block a user