forked from qt-creator/qt-creator
Update the curveeditor when changing keyframes in the text editor
Fixes: QDS-10062 Change-Id: Ie0364d095f17ba6b5f16bd8fbf9abddfca2f26db Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -68,8 +68,9 @@ void CurveEditorView::modelAboutToBeDetached(Model *model)
|
|||||||
|
|
||||||
bool dirtyfiesView(const ModelNode &node)
|
bool dirtyfiesView(const ModelNode &node)
|
||||||
{
|
{
|
||||||
return QmlTimeline::isValidQmlTimeline(node)
|
return (node.type() == "QtQuick.Timeline.Keyframe" && node.hasParentProperty())
|
||||||
|| QmlTimelineKeyframeGroup::isValidQmlTimelineKeyframeGroup(node);
|
|| QmlTimeline::isValidQmlTimeline(node)
|
||||||
|
|| QmlTimelineKeyframeGroup::isValidQmlTimelineKeyframeGroup(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CurveEditorView::nodeRemoved([[maybe_unused]] const ModelNode &removedNode,
|
void CurveEditorView::nodeRemoved([[maybe_unused]] const ModelNode &removedNode,
|
||||||
@@ -143,13 +144,8 @@ void CurveEditorView::variantPropertiesChanged([[maybe_unused]] const QList<Vari
|
|||||||
[[maybe_unused]] PropertyChangeFlags propertyChange)
|
[[maybe_unused]] PropertyChangeFlags propertyChange)
|
||||||
{
|
{
|
||||||
for (const auto &property : propertyList) {
|
for (const auto &property : propertyList) {
|
||||||
if ((property.name() == "frame" || property.name() == "value")
|
if (dirtyfiesView(property.parentModelNode()))
|
||||||
&& property.parentModelNode().type() == "QtQuick.Timeline.Keyframe"
|
updateKeyframes();
|
||||||
&& property.parentModelNode().hasParentProperty()) {
|
|
||||||
const ModelNode framesNode = property.parentModelNode().parentProperty().parentModelNode();
|
|
||||||
if (QmlTimelineKeyframeGroup::isValidQmlTimelineKeyframeGroup(framesNode))
|
|
||||||
updateKeyframes();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,20 +153,16 @@ void CurveEditorView::bindingPropertiesChanged([[maybe_unused]] const QList<Bind
|
|||||||
[[maybe_unused]] PropertyChangeFlags propertyChange)
|
[[maybe_unused]] PropertyChangeFlags propertyChange)
|
||||||
{
|
{
|
||||||
for (const auto &property : propertyList) {
|
for (const auto &property : propertyList) {
|
||||||
if (property.name() == "easing.bezierCurve") {
|
if (dirtyfiesView(property.parentModelNode()))
|
||||||
updateKeyframes();
|
updateKeyframes();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CurveEditorView::propertiesRemoved([[maybe_unused]] const QList<AbstractProperty> &propertyList)
|
void CurveEditorView::propertiesRemoved([[maybe_unused]] const QList<AbstractProperty> &propertyList)
|
||||||
{
|
{
|
||||||
for (const auto &property : propertyList) {
|
for (const auto &property : propertyList) {
|
||||||
if (property.name() == "keyframes") {
|
if (dirtyfiesView(property.parentModelNode()))
|
||||||
ModelNode parent = property.parentModelNode();
|
updateKeyframes();
|
||||||
if (dirtyfiesView(parent))
|
|
||||||
updateKeyframes();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user