MaterialOutputModel.py 988 B

123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright (c) 2017 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from typing import Optional
  4. from PyQt5.QtCore import pyqtProperty, QObject
  5. class MaterialOutputModel(QObject):
  6. def __init__(self, guid: Optional[str], type: str, color: str, brand: str, name: str, parent = None) -> None:
  7. super().__init__(parent)
  8. self._guid = guid
  9. self._type = type
  10. self._color = color
  11. self._brand = brand
  12. self._name = name
  13. @pyqtProperty(str, constant = True)
  14. def guid(self) -> str:
  15. return self._guid if self._guid else ""
  16. @pyqtProperty(str, constant = True)
  17. def type(self) -> str:
  18. return self._type
  19. @pyqtProperty(str, constant = True)
  20. def brand(self) -> str:
  21. return self._brand
  22. @pyqtProperty(str, constant = True)
  23. def color(self) -> str:
  24. return self._color
  25. @pyqtProperty(str, constant = True)
  26. def name(self) -> str:
  27. return self._name