Better typing

CURA-8849
This commit is contained in:
j.delarago 2022-06-15 17:41:21 +02:00
parent 6f8470167f
commit f9dda40409

View file

@ -2,9 +2,9 @@
# Cura is released under the terms of the LGPLv3 or higher. # Cura is released under the terms of the LGPLv3 or higher.
import collections import collections
from typing import OrderedDict from typing import OrderedDict, Optional
from PyQt6.QtCore import Qt, QTimer from PyQt6.QtCore import Qt, QTimer, QObject
import cura import cura
from UM import i18nCatalog from UM import i18nCatalog
@ -25,7 +25,7 @@ class IntentSelectionModel(ListModel):
DescriptionRole = Qt.ItemDataRole.UserRole + 4 DescriptionRole = Qt.ItemDataRole.UserRole + 4
IconRole = Qt.ItemDataRole.UserRole + 5 IconRole = Qt.ItemDataRole.UserRole + 5
def __init__(self, parent = None) -> None: def __init__(self, parent: Optional[QObject] = None) -> None:
super().__init__(parent) super().__init__(parent)
self.addRoleName(self.NameRole, "name") self.addRoleName(self.NameRole, "name")