From bbbda804aea58b006ed998bf54e581aa8c09e79b Mon Sep 17 00:00:00 2001 From: Blaine Date: Wed, 27 May 2020 05:13:47 +0530 Subject: merge-commit 2 --- src/main/python/utils/graphics.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/python/utils/graphics.py') diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py index 1e701f9..783748b 100644 --- a/src/main/python/utils/graphics.py +++ b/src/main/python/utils/graphics.py @@ -45,9 +45,9 @@ class customView(QGraphicsView): if QDropEvent.mimeData().hasText(): #QDropEvent.mimeData().text() defines intended drop item, the pos values define position obj = QDropEvent.mimeData().text().split('/') - graphic = getattr(shapes, obj[0])(*map(int, obj[1:])) - graphic.setPen(QPen(Qt.black, 2)) - graphic.setFlags(QGraphicsItem.ItemIsSelectable | QGraphicsItem.ItemIsMovable) + graphic = getattr(shapes, obj[0])(*map(lambda x: int(x) if x.isdigit() else x, obj[1:])) + # graphic.setPen(QPen(Qt.black, 2)) + # graphic.setFlags(QGraphicsItem.ItemIsSelectable | QGraphicsItem.ItemIsMovable) self.scene().addItemPlus(graphic) graphic.setPos(QDropEvent.pos().x()-150, QDropEvent.pos().y()-150) QDropEvent.acceptProposedAction() -- cgit