mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 19:45:57 +08:00
Merge pull request #12635 from Ultimaker/CURA-9270_discard_or_keep_changes_not_updating
Add the "clear" hack to the tableModel for discardOrkeepchanges
This commit is contained in:
commit
7ae1b2a074
@ -24,6 +24,16 @@ UM.Dialog
|
|||||||
|
|
||||||
property var changesModel: Cura.UserChangesModel { id: userChangesModel }
|
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:
|
onVisibilityChanged:
|
||||||
{
|
{
|
||||||
if(visible)
|
if(visible)
|
||||||
@ -78,8 +88,9 @@ UM.Dialog
|
|||||||
]
|
]
|
||||||
model: UM.TableModel
|
model: UM.TableModel
|
||||||
{
|
{
|
||||||
|
id: tableModel
|
||||||
headers: ["label", "original_value", "user_value"]
|
headers: ["label", "original_value", "user_value"]
|
||||||
rows: userChangesModel.items
|
rows: modelRows
|
||||||
}
|
}
|
||||||
sectionRole: "category"
|
sectionRole: "category"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user