summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
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):