Beispiel #1
0
 def __init__(self, parent=None):
     super(GraphicsView, self).__init__(parent)
     self.setDragMode(QGraphicsView.RubberBandDrag)
     self.setSceneRect(QtCore.QRectF(-2000, -2000, 4000, 4000))
     self.setRenderHint(QPainter.Antialiasing)
     self.setRenderHint(QPainter.TextAntialiasing)
     self.setAcceptDrops(True)
Beispiel #2
0
 def find_itemAt(self, pos):
     items = self.items(
         QtCore.QRectF(pos - QtCore.QPointF(1, 1), QtCore.QSizeF(3, 3)))
     for item in items:
         if isinstance(item,
                       QGraphicsItem) and not isinstance(item, Connection):
             return item
     return None
Beispiel #3
0
 def itemAt(self, pos):
     items = self.scene.items(
         QtCore.QRectF(pos - QtCore.QPointF(DB, DB),
                       QtCore.QSizeF(2 * DB, 2 * DB)))
     for item in items:
         if isinstance(item, QGraphicsItem):
             return item
     return None