Qt5->Qt6: Rectify constant locations: UserRole, CppOwnership

part of CURA-8591
This commit is contained in:
Remco Burema 2021-12-28 14:54:56 +01:00
parent abe7c1bf7f
commit 32b52c6166
No known key found for this signature in database
GPG key ID: 215C49431D43F98C
25 changed files with 167 additions and 167 deletions

View file

@ -23,43 +23,43 @@ class ExtrudersModel(ListModel):
"""
# The ID of the container stack for the extruder.
IdRole = Qt.UserRole + 1
IdRole = Qt.ItemDataRole.UserRole + 1
NameRole = Qt.UserRole + 2
NameRole = Qt.ItemDataRole.UserRole + 2
"""Human-readable name of the extruder."""
ColorRole = Qt.UserRole + 3
ColorRole = Qt.ItemDataRole.UserRole + 3
"""Colour of the material loaded in the extruder."""
IndexRole = Qt.UserRole + 4
IndexRole = Qt.ItemDataRole.UserRole + 4
"""Index of the extruder, which is also the value of the setting itself.
An index of 0 indicates the first extruder, an index of 1 the second one, and so on. This is the value that will
be saved in instance containers. """
# The ID of the definition of the extruder.
DefinitionRole = Qt.UserRole + 5
DefinitionRole = Qt.ItemDataRole.UserRole + 5
# The material of the extruder.
MaterialRole = Qt.UserRole + 6
MaterialRole = Qt.ItemDataRole.UserRole + 6
# The variant of the extruder.
VariantRole = Qt.UserRole + 7
StackRole = Qt.UserRole + 8
VariantRole = Qt.ItemDataRole.UserRole + 7
StackRole = Qt.ItemDataRole.UserRole + 8
MaterialBrandRole = Qt.UserRole + 9
ColorNameRole = Qt.UserRole + 10
MaterialBrandRole = Qt.ItemDataRole.UserRole + 9
ColorNameRole = Qt.ItemDataRole.UserRole + 10
EnabledRole = Qt.UserRole + 11
EnabledRole = Qt.ItemDataRole.UserRole + 11
"""Is the extruder enabled?"""
MaterialTypeRole = Qt.UserRole + 12
MaterialTypeRole = Qt.ItemDataRole.UserRole + 12
"""The type of the material (e.g. PLA, ABS, PETG, etc.)."""
defaultColors = ["#ffc924", "#86ec21", "#22eeee", "#245bff", "#9124ff", "#ff24c8"]
"""List of colours to display if there is no material or the material has no known colour. """
MaterialNameRole = Qt.UserRole + 13
MaterialNameRole = Qt.ItemDataRole.UserRole + 13
def __init__(self, parent = None):
"""Initialises the extruders model, defining the roles and listening for changes in the data.