From 638db3c35b28c198e05992105eda7c29dde98395 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 20 Apr 2021 16:23:42 +0200 Subject: [PATCH] QmlDesigner: Remove the custom notification "INSERT_KEYFRAME" Adding a keyframe can be done directly in the PropertyEditor. Change-Id: I38fa87a8bcf4f551890c4ada748301cdeea9f165 Reviewed-by: Knud Dollereder Reviewed-by: Thomas Hartmann --- .../propertyeditorcontextobject.cpp | 16 ++++++++++------ .../components/timelineeditor/timelineview.cpp | 2 -- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp index 967f5cbd4c5..a7161bbbe2f 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp @@ -28,10 +28,11 @@ #include #include -#include -#include -#include #include +#include +#include +#include +#include #include #include @@ -310,9 +311,12 @@ void PropertyEditorContextObject::insertKeyframe(const QString &propertyName) ModelNode selectedNode = rewriterView->selectedModelNodes().constFirst(); - rewriterView->emitCustomNotification("INSERT_KEYFRAME", - { selectedNode }, - { propertyName }); + QmlTimeline timeline = rewriterView->currentTimeline(); + + QTC_ASSERT(timeline.isValid(), return ); + QTC_ASSERT(selectedNode.isValid(), return ); + + timeline.insertKeyframe(selectedNode, propertyName.toUtf8()); } int PropertyEditorContextObject::majorVersion() const diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp index a8d0d740823..3467d88d442 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp @@ -423,8 +423,6 @@ void TimelineView::customNotification(const AbstractView * /*view*/, QmlTimeline timeline = widget()->graphicsScene()->currentTimeline(); if (timeline.isValid()) timeline.modelNode().removeAuxiliaryData("currentFrame@NodeInstance"); - } else if (identifier == "INSERT_KEYFRAME" && !nodeList.isEmpty() && !data.isEmpty()) { - insertKeyframe(nodeList.constFirst(), data.constFirst().toString().toUtf8()); } }