示例#1
0
 def dragMoveEvent(self, event: QGraphicsSceneDragDropEvent):
     event.accept()
示例#2
0
 def dragEnterEvent(self, event: QGraphicsSceneDragDropEvent):
     event.accept()
示例#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)
示例#4
0
文件: common.py 项目: cdzkhxhdgs/sift
def send_mime(event: QGraphicsSceneDragDropEvent, mimetype: str, obj):
    qb = QByteArray(pkl.dumps(obj, protocol=pkl.HIGHEST_PROTOCOL))
    event.setData(mimetype, qb)
示例#5
0
 def dragLeaveEvent(self, event: QGraphicsSceneDragDropEvent):
     self._dragging = False
     event.setAccepted(False)
示例#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)