forked from qt-creator/qt-creator
QmlDesigner: Add transaction to deleteDynamicPropertyByRow()
Change-Id: Iebbd127ba43698b82e7f7124c5b929e406687f22 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -417,16 +417,18 @@ QStringList DynamicPropertiesModel::possibleSourceProperties(const BindingProper
|
||||
|
||||
void DynamicPropertiesModel::deleteDynamicPropertyByRow(int rowNumber)
|
||||
{
|
||||
BindingProperty bindingProperty = bindingPropertyForRow(rowNumber);
|
||||
if (bindingProperty.isValid()) {
|
||||
bindingProperty.parentModelNode().removeProperty(bindingProperty.name());
|
||||
}
|
||||
connectionView()->executeInTransaction("DynamicPropertiesModel::deleteDynamicPropertyByRow", [this, rowNumber]() {
|
||||
BindingProperty bindingProperty = bindingPropertyForRow(rowNumber);
|
||||
if (bindingProperty.isValid()) {
|
||||
bindingProperty.parentModelNode().removeProperty(bindingProperty.name());
|
||||
}
|
||||
|
||||
VariantProperty variantProperty = variantPropertyForRow(rowNumber);
|
||||
VariantProperty variantProperty = variantPropertyForRow(rowNumber);
|
||||
|
||||
if (variantProperty.isValid()) {
|
||||
variantProperty.parentModelNode().removeProperty(variantProperty.name());
|
||||
}
|
||||
if (variantProperty.isValid()) {
|
||||
variantProperty.parentModelNode().removeProperty(variantProperty.name());
|
||||
}
|
||||
});
|
||||
|
||||
resetModel();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user