From a4a2642e9d9934c65a853d17c899ea9337ab9c5e Mon Sep 17 00:00:00 2001 From: Blaine Date: Tue, 9 Jun 2020 14:25:52 +0530 Subject: complete loading --- src/main/python/utils/canvas.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/main/python') diff --git a/src/main/python/utils/canvas.py b/src/main/python/utils/canvas.py index d1da9bc..93a7722 100644 --- a/src/main/python/utils/canvas.py +++ b/src/main/python/utils/canvas.py @@ -144,6 +144,8 @@ class canvas(QWidget): graphic.__setstate__(dict = item) self.painter.addItem(graphic) graphic.setPos(*item['pos']) + graphic.updateLineGripItem() + graphic.updateSizeGripItem() for gripitem in item['lineGripItems']: shapeGrips[gripitem[0]] = (graphic, gripitem[1]) @@ -151,18 +153,21 @@ class canvas(QWidget): line = shapes.Line(QPointF(*item['startPoint']), QPointF(*item['endPoint'])) lines[item['id']] = line line.__setstate__(dict = item) + self.painter.addItem(line) graphic, index = shapeGrips[item['startGripItem']] - line.setStartGripItem = graphic.lineGripItems[index] + line.startGripItem = graphic.lineGripItems[index] graphic.lineGripItems[index].line = line - if item['endGripItem']: + if item['endGripItem']: graphic, index = shapeGrips[item['endGripItem']] - line.setEndGripItem = graphic.lineGripItems[index] + print(graphic.lineGripItems[index]) + line.endGripItem = graphic.lineGripItems[index] graphic.lineGripItems[index].line = line else: line.refLine = lines[item['refLine']] + lines[item['refLine']].midLines.append(line) line.refIndex = item['refIndex'] - self.painter.addItem(line) - # line.addGrabber() + line.updateLine() + line.addGrabber() shapeGrips.clear() lines.clear() -- cgit