From db78fa9cf84bf7cae0a5247b2f76f650e72f17a1 Mon Sep 17 00:00:00 2001 From: Knud Dollereder Date: Tue, 27 Jun 2023 16:35:57 +0200 Subject: [PATCH] Update the curveeditor when changing keyframes in the text editor Fixes: QDS-10062 Change-Id: Ie0364d095f17ba6b5f16bd8fbf9abddfca2f26db Reviewed-by: Reviewed-by: Thomas Hartmann --- .../curveeditor/curveeditorview.cpp | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp b/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp index 1d0b38b3f15..e7395c66625 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp @@ -68,8 +68,9 @@ void CurveEditorView::modelAboutToBeDetached(Model *model) bool dirtyfiesView(const ModelNode &node) { - return QmlTimeline::isValidQmlTimeline(node) - || QmlTimelineKeyframeGroup::isValidQmlTimelineKeyframeGroup(node); + return (node.type() == "QtQuick.Timeline.Keyframe" && node.hasParentProperty()) + || QmlTimeline::isValidQmlTimeline(node) + || QmlTimelineKeyframeGroup::isValidQmlTimelineKeyframeGroup(node); } void CurveEditorView::nodeRemoved([[maybe_unused]] const ModelNode &removedNode, @@ -143,13 +144,8 @@ void CurveEditorView::variantPropertiesChanged([[maybe_unused]] const QList &propertyList) { for (const auto &property : propertyList) { - if (property.name() == "keyframes") { - ModelNode parent = property.parentModelNode(); - if (dirtyfiesView(parent)) - updateKeyframes(); - } + if (dirtyfiesView(property.parentModelNode())) + updateKeyframes(); } }