aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKnud Dollereder <knud.dollereder@qt.io>2022-05-25 15:38:17 +0200
committerKnud Dollereder <knud.dollereder@qt.io>2022-05-30 09:39:18 +0000
commitbf69c6c3a94ab0c2747039dcb6c517390ccbcc6f (patch)
treeb1b2896dbb1ba64cfbe12c4bc97d6f04e4fafac0
parent1eb741395cbe0c2195912c0fd1fe6030c74e9109 (diff)
Do not update animation range from inactive timelines
In a scene with multiple states and timelines it occasionally happend that the curve editor was updated from an inactive timeline. This is now fixed. Fixes: QDS-6948 Change-Id: I586593452e69cebe7bb2571e301230bf0ace8631 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp b/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp
index eee4b69db6..7421d7b665 100644
--- a/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp
+++ b/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp
@@ -149,16 +149,23 @@ void CurveEditorView::instancePropertyChanged(const QList<QPair<ModelNode, Prope
{
Q_UNUSED(propertyList);
- for (const auto &pair : propertyList) {
- if (!QmlTimeline::isValidQmlTimeline(pair.first))
- continue;
-
- if (pair.second == "startFrame")
- updateStartFrame(pair.first);
- else if (pair.second == "endFrame")
- updateEndFrame(pair.first);
- else if (pair.second == "currentFrame")
- updateCurrentFrame(pair.first);
+ if (auto timeline = activeTimeline(); timeline.isValid()) {
+
+ auto timelineNode = timeline.modelNode();
+ for (const auto &pair : propertyList) {
+ if (!QmlTimeline::isValidQmlTimeline(pair.first))
+ continue;
+
+ if (pair.first != timelineNode)
+ continue;
+
+ if (pair.second == "startFrame")
+ updateStartFrame(pair.first);
+ else if (pair.second == "endFrame")
+ updateEndFrame(pair.first);
+ else if (pair.second == "currentFrame")
+ updateCurrentFrame(pair.first);
+ }
}
}