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()
def dragEnterEvent(self, event: QDragEnterEvent) -> None: self.setDisabled(True) self.repaint() urls = event.mimeData().urls() if not urls: self.setDisabled(False) self.setFocus() event.ignore() return for url in urls: try: parse = urlparse(url.toString()) if parse.scheme not in ['file']: self.setDisabled(False) event.ignore() return filepath = Path(url.toLocalFile()) if isArchive(filepath) or containsValidMod(filepath, searchlimit=8)[0]: self.setDisabled(False) event.accept() return except Exception as e: logger.debug(str(e)) self.setDisabled(False) self.setFocus() event.ignore()
def dragEnterEvent(self, event: QtGui.QDragEnterEvent): if event.mimeData().hasFormat("text/plain") and self.drag: event.accept() else: event.ignore()
def dragEnterEvent(self, event: QDragEnterEvent): if event.mimeData().hasUrls(): if self._get_drop_event_files(event.mimeData()): event.acceptProposedAction() else: event.ignore()