Exemplo n.º 1
0
 def dragMoveEvent(self, event: QGraphicsSceneDragDropEvent):
     event.accept()
Exemplo n.º 2
0
 def dragEnterEvent(self, event: QGraphicsSceneDragDropEvent):
     event.accept()
Exemplo n.º 3
0
 def dragMoveEvent(self, event: QGraphicsSceneDragDropEvent):
     if any(item.acceptDrops() for item in self.items(event.scenePos())):
         super().dragMoveEvent(event)
     else:
         event.setAccepted(True)
Exemplo n.º 4
0
def send_mime(event: QGraphicsSceneDragDropEvent, mimetype: str, obj):
    qb = QByteArray(pkl.dumps(obj, protocol=pkl.HIGHEST_PROTOCOL))
    event.setData(mimetype, qb)
Exemplo n.º 5
0
 def dragLeaveEvent(self, event: QGraphicsSceneDragDropEvent):
     self._dragging = False
     event.setAccepted(False)
Exemplo n.º 6
0
 def dragMoveEvent(self, event: QGraphicsSceneDragDropEvent):
     if any(item.acceptDrops() for item in self.items(event.scenePos())):
         super().dragMoveEvent(event)
     else:
         event.setAccepted(True)