summaryrefslogtreecommitdiff
path: root/canvas.py
diff options
context:
space:
mode:
authorsumit2020-04-24 14:45:47 +0530
committersumit2020-04-24 14:45:47 +0530
commitdae95c4b5369d629e6033cc082c526ef042cf497 (patch)
tree1e56332b0853ca7f7cf90b0aab9ae6cba69d5e97 /canvas.py
parent0c693cdeb2cce18a61cc93a6c042eaa2d4b15752 (diff)
downloadChemical-PFD-dae95c4b5369d629e6033cc082c526ef042cf497.tar.gz
Chemical-PFD-dae95c4b5369d629e6033cc082c526ef042cf497.tar.bz2
Chemical-PFD-dae95c4b5369d629e6033cc082c526ef042cf497.zip
add svg file
Diffstat (limited to 'canvas.py')
-rw-r--r--canvas.py23
1 files changed, 23 insertions, 0 deletions
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
+
+