mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 02:35:53 +08:00
Merge pull request #11577 from Ultimaker/CURA-8931_extruder_tabs_profile_manager_window
Add workaround for TableModel not updating when rows are set directly
This commit is contained in:
commit
9aee7fa78a
@ -16,6 +16,16 @@ Cura.TableView
|
|||||||
property int extruderPosition: -1 //The extruder to display. -1 denotes the global stack.
|
property int extruderPosition: -1 //The extruder to display. -1 denotes the global stack.
|
||||||
property bool isQualityItemCurrentlyActivated: qualityItem != null && qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName
|
property bool isQualityItemCurrentlyActivated: qualityItem != null && qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName
|
||||||
|
|
||||||
|
// 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: qualitySettings.items
|
||||||
|
onModelRowsChanged:
|
||||||
|
{
|
||||||
|
tableModel.clear()
|
||||||
|
tableModel.rows = modelRows
|
||||||
|
}
|
||||||
|
|
||||||
Cura.QualitySettingsModel
|
Cura.QualitySettingsModel
|
||||||
{
|
{
|
||||||
id: qualitySettings
|
id: qualitySettings
|
||||||
@ -31,11 +41,12 @@ Cura.TableView
|
|||||||
]
|
]
|
||||||
model: TableModel
|
model: TableModel
|
||||||
{
|
{
|
||||||
|
id: tableModel
|
||||||
TableModelColumn { display: "label" }
|
TableModelColumn { display: "label" }
|
||||||
TableModelColumn { display: "profile_value" }
|
TableModelColumn { display: "profile_value" }
|
||||||
TableModelColumn { display: "user_value" }
|
TableModelColumn { display: "user_value" }
|
||||||
TableModelColumn { display: "unit" }
|
TableModelColumn { display: "unit" }
|
||||||
rows: qualitySettings.items
|
rows: modelRows
|
||||||
}
|
}
|
||||||
sectionRole: "category"
|
sectionRole: "category"
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user