Beispiel #1
0
 def dragEnterEvent(self, event: QDragEnterEvent):
     if not self.terrain_mode and event.mimeData().hasFormat(
             "application/fe14-spawn"):
         self.spawn_dragged_over.emit(self.row, self.column)
         event.acceptProposedAction()
     else:
         event.ignore()
Beispiel #2
0
    def dragEnterEvent(self, event: QtGui.QDragEnterEvent):
        from randovania.layout.preset_migration import VersionedPreset

        valid_extensions = [
            LayoutDescription.file_extension(),
            VersionedPreset.file_extension(),
        ]
        valid_extensions_with_dot = {
            f".{extension}"
            for extension in valid_extensions
        }

        for url in event.mimeData().urls():
            ext = os.path.splitext(url.toLocalFile())[1]
            if ext in valid_extensions_with_dot:
                event.acceptProposedAction()
                return
Beispiel #3
0
 def dragEnterEvent(self, event: QtGui.QDragEnterEvent) -> None:
     if event.mimeData().hasUrls():
         event.acceptProposedAction()
     else:  # pragma: no cover
         super().dragEnterEvent(event)
 def dragEnterEvent(self, event: QtGui.QDragEnterEvent):
     if (event.mimeData().hasImage() or event.mimeData().hasUrls()):
         event.acceptProposedAction()
Beispiel #5
0
 def dragEnterEvent(self, event: QDragEnterEvent):
     if event.mimeData().hasFormat("application/level-object"):
         event.acceptProposedAction()
 def dragEnterEvent(self, event: QDragEnterEvent):
     mime_data: QMimeData = event.mimeData()
     if mime_data.hasUrls() and len(mime_data.urls()[0].toLocalFile()) > 0:
         event.acceptProposedAction()
 def dragEnterEvent(self, event: QDragEnterEvent):
     if event.mimeData().hasUrls():
         event.acceptProposedAction()
Beispiel #8
0
 def dragEnterEvent(self, a0: QtGui.QDragEnterEvent) -> None:
     if a0.source() is self:
         self.drag_start_row = self.indexAt(a0.pos()).row()
         a0.acceptProposedAction()
Beispiel #9
0
 def dragEnterEvent(
         self, event: QtGui.QDragEnterEvent) -> None:  # pragma: no cover
     if event.mimeData().hasFormat("application/x-pew2tabbar"):
         event.acceptProposedAction()
Beispiel #10
0
 def dragEnterEvent(self, event: QtGui.QDragEnterEvent):
     if event.mimeData().hasFormat("text/plain"):
         event.acceptProposedAction()
Beispiel #11
0
 def dragEnterEvent(self, event: QDragEnterEvent):
     if event.mimeData().hasUrls():
         if self._get_drop_event_files(event.mimeData()):
             event.acceptProposedAction()
         else:
             event.ignore()