QmlDesigner: Fix usage of transaction

We have to update the model _inside_ the transaction of course.
Without this patch the last changes were done after the
transaction was already closed.

Task-number: QDS-1194
Change-Id: I1061990f8b713ee5c25737b8eb173866fb495511
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Thomas Hartmann
2019-10-30 17:28:21 +01:00
parent c66e96a840
commit 2e95916e7c

View File

@@ -1225,8 +1225,6 @@ void NodeInstanceView::valuesModified(const ValuesModifiedCommand &command)
if (command.transactionOption == ValuesModifiedCommand::TransactionOption::Start) if (command.transactionOption == ValuesModifiedCommand::TransactionOption::Start)
startPuppetTransaction(); startPuppetTransaction();
else if (command.transactionOption == ValuesModifiedCommand::TransactionOption::End)
endPuppetTransaction();
for (const PropertyValueContainer &container : command.valueChanges()) { for (const PropertyValueContainer &container : command.valueChanges()) {
if (hasInstanceForId(container.instanceId())) { if (hasInstanceForId(container.instanceId())) {
@@ -1239,6 +1237,9 @@ void NodeInstanceView::valuesModified(const ValuesModifiedCommand &command)
} }
} }
} }
if (command.transactionOption == ValuesModifiedCommand::TransactionOption::End)
endPuppetTransaction();
} }
void NodeInstanceView::pixmapChanged(const PixmapChangedCommand &command) void NodeInstanceView::pixmapChanged(const PixmapChangedCommand &command)