Example #1
0
 def dragMoveEvent(self, event: QGraphicsSceneDragDropEvent):
     event.accept()
Example #2
0
 def dragEnterEvent(self, event: QGraphicsSceneDragDropEvent):
     event.accept()
Example #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)
Example #4
0
def send_mime(event: QGraphicsSceneDragDropEvent, mimetype: str, obj):
    qb = QByteArray(pkl.dumps(obj, protocol=pkl.HIGHEST_PROTOCOL))
    event.setData(mimetype, qb)
Example #5
0
 def dragLeaveEvent(self, event: QGraphicsSceneDragDropEvent):
     self._dragging = False
     event.setAccepted(False)
Example #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)