diff options
author | Jaime van Kessel <nallath@gmail.com> | 2022-06-29 14:34:41 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2022-06-29 14:34:41 +0300 |
commit | a8a2fd8007801d1eba09318b908246a21bb3a28d (patch) | |
tree | b2b45f4261078d86661273bb14c0b4a6a0f15f35 /resources/qml | |
parent | f241638890ac1076546f01593c5ccb3253812d51 (diff) |
Add the "clear" hack to the tableModel for discardOrkeepchangesCURA-9270_discard_or_keep_changes_not_updating
It's the same hack that we already use for the other instances where we use the tableModel.
For some reason it wasn't done here, so we also had the not updating bug
CURA-9270
Diffstat (limited to 'resources/qml')
-rw-r--r-- | resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 0579cb3c30..0b39d84177 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -24,6 +24,16 @@ UM.Dialog property var changesModel: Cura.UserChangesModel { id: userChangesModel } + // Hack to make sure that when the data of our model changes the tablemodel is also updated + // If we directly set the rows (So without the clear being called) it doesn't seem to + // get updated correctly. + property var modelRows: userChangesModel.items + onModelRowsChanged: + { + tableModel.clear() + tableModel.rows = modelRows + } + onVisibilityChanged: { if(visible) @@ -78,8 +88,9 @@ UM.Dialog ] model: UM.TableModel { + id: tableModel headers: ["label", "original_value", "user_value"] - rows: userChangesModel.items + rows: modelRows } sectionRole: "category" } |