QmlDesigner: Crash fix

* Add QTC_CHECK for crash
* ActionAreas should not be "garbage" collected if they have no target.

* Initial ActionAreas do not have a target and ActionAreas without target make sense to a user. We do not want to delete them together with the target.

Task-number: QDS-12181
Change-Id: Ie520c47aad990a8ff07fc3346e6772226d334ce5
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Thomas Hartmann
2024-03-21 14:46:40 +01:00
parent 33ec9d9690
commit f63bd7f933
4 changed files with 2 additions and 4 deletions

View File

@@ -174,6 +174,7 @@ public:
ModelNode targetTransition() const;
void assignTargetFlowItem(const QmlFlowTargetNode &flowItem);
QmlFlowItemNode flowItemParent() const;
private:
void destroyTarget();
};

View File

@@ -515,8 +515,7 @@ struct BindingFilter
struct TargetFilter
{
TargetFilter(NodeDependencies &dependencies, Model *model)
: flowViewFlowActionAreaMetaInfo{model->flowViewFlowActionAreaMetaInfo()}
, flowViewFlowTransitionMetaInfo{model->flowViewFlowTransitionMetaInfo()}
: flowViewFlowTransitionMetaInfo{model->flowViewFlowTransitionMetaInfo()}
, qtQuickPropertyChangesMetaInfo{model->qtQuickPropertyChangesMetaInfo()}
, qtQuickTimelineKeyframeGroupMetaInfo{model->qtQuickTimelineKeyframeGroupMetaInfo()}
, qtQuickPropertyAnimationMetaInfo{model->qtQuickPropertyAnimationMetaInfo()}

View File

@@ -748,7 +748,6 @@ void QmlFlowActionAreaNode::assignTargetFlowItem(const QmlFlowTargetNode &flowIt
ModelNode transition = flowView.addTransition(flowParent.modelNode(),
flowItem.modelNode());
modelNode().bindingProperty("target").setExpression(transition.validId());
}

View File

@@ -280,7 +280,6 @@ INSTANTIATE_TEST_SUITE_P(
ForTarget,
testing::Values(TargetData{"QtQuick.Item", "QtQuick.PropertyChanges", "target"},
TargetData{"QtQuick.Item", "QtQuick.Timeline.KeyframeGroup", "target"},
TargetData{"FlowView.FlowTransition", "FlowView.FlowActionArea", "target"},
TargetData{"QtQuick.Item", "QtQuick.PropertyAnimation", "target"},
TargetData{"FlowView.FlowItem", "FlowView.FlowTransition", "to"},
TargetData{"FlowView.FlowItem", "FlowView.FlowTransition", "from"}));