mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Fix issue with deprecation and pyqtSlot
This commit is contained in:
parent
8311a39f08
commit
a3dad0fa09
1 changed files with 5 additions and 2 deletions
|
@ -986,10 +986,13 @@ class MachineManager(QObject):
|
|||
self._application.globalContainerStackChanged.emit()
|
||||
self.forceUpdateAllSettings()
|
||||
|
||||
# Note that this function is deprecated, but the decorators for this don't play well together!
|
||||
# @deprecated("use Cura.MachineManager.activeMachine.extruders instead", "4.2")
|
||||
@pyqtSlot(int, result = QObject)
|
||||
def getExtruder(self, position: int) -> Optional[ExtruderStack]:
|
||||
return self._getExtruder(position)
|
||||
|
||||
# This is a workaround for the deprecated decorator and the pyqtSlot not playing well together.
|
||||
@deprecated("use Cura.MachineManager.activeMachine.extruders instead", "4.2")
|
||||
def _getExtruder(self, position) -> Optional[ExtruderStack]:
|
||||
if self._global_container_stack:
|
||||
return self._global_container_stack.extruders.get(str(position))
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue