mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Change to layer_height and layer_height_unit
This commit is contained in:
parent
b74e2553e7
commit
e87077802f
3 changed files with 7 additions and 7 deletions
|
@ -17,7 +17,7 @@ class QualityProfilesDropDownMenuModel(ListModel):
|
|||
NameRole = Qt.UserRole + 1
|
||||
QualityTypeRole = Qt.UserRole + 2
|
||||
LayerHeightRole = Qt.UserRole + 3
|
||||
LayerHeightWithoutUnitRole = Qt.UserRole + 4
|
||||
LayerHeightUnitRole = Qt.UserRole + 4
|
||||
AvailableRole = Qt.UserRole + 5
|
||||
QualityGroupRole = Qt.UserRole + 6
|
||||
QualityChangesGroupRole = Qt.UserRole + 7
|
||||
|
@ -28,7 +28,7 @@ class QualityProfilesDropDownMenuModel(ListModel):
|
|||
self.addRoleName(self.NameRole, "name")
|
||||
self.addRoleName(self.QualityTypeRole, "quality_type")
|
||||
self.addRoleName(self.LayerHeightRole, "layer_height")
|
||||
self.addRoleName(self.LayerHeightWithoutUnitRole, "layer_height_without_unit")
|
||||
self.addRoleName(self.LayerHeightUnitRole, "layer_height_unit")
|
||||
self.addRoleName(self.AvailableRole, "available")
|
||||
self.addRoleName(self.QualityGroupRole, "quality_group")
|
||||
self.addRoleName(self.QualityChangesGroupRole, "quality_changes_group")
|
||||
|
@ -70,15 +70,15 @@ class QualityProfilesDropDownMenuModel(ListModel):
|
|||
|
||||
item = {"name": quality_group.name,
|
||||
"quality_type": quality_group.quality_type,
|
||||
"layer_height": layer_height + self._layer_height_unit,
|
||||
"layer_height_without_unit": layer_height,
|
||||
"layer_height": layer_height,
|
||||
"layer_height_unit": self._layer_height_unit,
|
||||
"available": quality_group.is_available,
|
||||
"quality_group": quality_group}
|
||||
|
||||
item_list.append(item)
|
||||
|
||||
# Sort items based on layer_height
|
||||
item_list = sorted(item_list, key = lambda x: float(x["layer_height_without_unit"]))
|
||||
item_list = sorted(item_list, key = lambda x: float(x["layer_height"]))
|
||||
|
||||
self.setItems(item_list)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue