summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorBlaine2020-05-15 11:56:00 +0530
committerBlaine2020-05-15 11:56:00 +0530
commite666d20c72138e1cb679b2877d90604c06130926 (patch)
tree3ae511ca3444bb74a76c190b2c5ab9eff5dc4303 /src/main
parentaab2924c33eaa4de26203aee76a8e1f4a8ee559d (diff)
downloadChemical-PFD-e666d20c72138e1cb679b2877d90604c06130926.tar.gz
Chemical-PFD-e666d20c72138e1cb679b2877d90604c06130926.tar.bz2
Chemical-PFD-e666d20c72138e1cb679b2877d90604c06130926.zip
working fix
Diffstat (limited to 'src/main')
-rw-r--r--src/main/python/utils/graphics.py4
-rw-r--r--src/main/python/utils/toolbar.py5
2 files changed, 3 insertions, 6 deletions
diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py
index 243b086..48d031b 100644
--- a/src/main/python/utils/graphics.py
+++ b/src/main/python/utils/graphics.py
@@ -25,8 +25,8 @@ class customView(QGraphicsView):
QDragMoveEvent.acceptProposedAction()
def dropEvent(self, QDropEvent):
- if QDropEvent.mimeData().hasText():
- graphic = getattr(QtWidgets, QDropEvent.mimeData().text())(QDropEvent.pos().x(), QDropEvent.pos().y(), 300, 300)
+ if QDropEvent.mimeData().hasText():
+ graphic = getattr(QtWidgets, QDropEvent.mimeData().text())(QDropEvent.pos().x()-150, QDropEvent.pos().y()-150, 300, 300)
graphic.setPen(QPen(Qt.black, 2))
graphic.setFlags(QGraphicsItem.ItemIsSelectable | QGraphicsItem.ItemIsMovable)
self.scene().addItem(graphic)
diff --git a/src/main/python/utils/toolbar.py b/src/main/python/utils/toolbar.py
index 1c0a492..5abdbd4 100644
--- a/src/main/python/utils/toolbar.py
+++ b/src/main/python/utils/toolbar.py
@@ -106,12 +106,9 @@ class toolbarButton(QToolButton):
self.setToolTip(item["name"])
def mousePressEvent(self, event):
+ super(toolbarButton, self).mousePressEvent(event)
if event.button() == Qt.LeftButton:
- # if event.wasHeld:
self.dragStartPosition = event.pos()
- # else:
- # # super(toolbarButton, self).mousePressEvent(event)
- # self.clicked.emit()
def mouseMoveEvent(self, event):
if not (event.buttons() and Qt.LeftButton):