Fix unit test due to QualityGroup parent changes

This commit is contained in:
Lipu Fei 2019-10-01 11:20:24 +02:00
parent 961e1e0d7e
commit bc524b2c14
4 changed files with 28 additions and 21 deletions

View file

@ -3,7 +3,7 @@
from typing import Any, Dict, Optional
from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty
from PyQt5.QtCore import QObject, pyqtProperty
## Data struct to group several quality changes instance containers together.
@ -15,14 +15,6 @@ class QualityChangesGroup(QObject):
def __init__(self, name: str, quality_type: str, intent_category: str, parent: Optional["QObject"] = None) -> None:
super().__init__(parent)
# CURA-6599
# For some reason, QML will get null or fail to convert type for MachineManager.activeQualityChangesGroup() to
# a QObject. Setting the object ownership to QQmlEngine.CppOwnership doesn't work, but setting the object
# parent to application seems to work.
from cura.CuraApplication import CuraApplication
self.setParent(CuraApplication.getInstance())
self._name = name
self.quality_type = quality_type
self.intent_category = intent_category