diff options
author | Blaine | 2020-06-09 04:53:48 +0530 |
---|---|---|
committer | Blaine | 2020-06-09 04:53:48 +0530 |
commit | 994a0f5c1fb80d0065b8fd3134111ca8790b46bd (patch) | |
tree | 420407e3c38806ca9e1461713c31bc890dcf3f89 /src/main/python/shapes | |
parent | bfa6cdf2e858e4a08e7e51dbf6d6cddc8d4183b7 (diff) | |
download | Chemical-PFD-994a0f5c1fb80d0065b8fd3134111ca8790b46bd.tar.gz Chemical-PFD-994a0f5c1fb80d0065b8fd3134111ca8790b46bd.tar.bz2 Chemical-PFD-994a0f5c1fb80d0065b8fd3134111ca8790b46bd.zip |
conflicted commits
Diffstat (limited to 'src/main/python/shapes')
-rw-r--r-- | src/main/python/shapes/shapes.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 3e5cbb2..2da1ca0 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -499,6 +499,24 @@ class NodeItem(QGraphicsSvgItem): if action == addLableAction: self.label = ItemLabel(event.scenePos(), self) + def __getstate__(self): + return { + "_classname_": self.__class__.__name__, + "width": self.width, + "height": self.height, + "pos": (self.pos.x(), self.pos.y()) + } + + def __setstate__(self, dict): + self.prepareGeometryChange() + self.width = dict['width'] + self.height = dict['height'] + self.rect = QRectF(-self.width / 2, -self.height / 2, self.width, self.height) + transform = QTransform() + transform.translate(self.width / 2, self.height / 2) + self.setTransform(transform, True) + self.updateSizeGripItem() + # classes of pfd-symbols class AirBlownCooler(NodeItem): def __init__(self): |