From dae95c4b5369d629e6033cc082c526ef042cf497 Mon Sep 17 00:00:00 2001 From: sumit Date: Fri, 24 Apr 2020 14:45:47 +0530 Subject: add svg file --- canvas.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 canvas.py (limited to 'canvas.py') diff --git a/canvas.py b/canvas.py new file mode 100644 index 0000000..36652a9 --- /dev/null +++ b/canvas.py @@ -0,0 +1,23 @@ +from PyQt5.QtCore import Qt +from PyQt5.QtWidgets import QGraphicsScene, QMenu, QGraphicsView + +from connectingline import ConnectingLine +from circle import NodeItem + + +class Canvas(QGraphicsScene): + MoveItem, InsertLine = 1, 2 + myMode = MoveItem + + def __init__(self, parent=None): + QGraphicsScene.__init__(self, parent) + self.lines = [] + self.circles = [] + + def setMode(self, mode): + """This function is used to toggle between move and add line + :return: + """ + Canvas.myMode = mode + + -- cgit