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): event.accept()
def dragEnterEvent(self, event: QtGui.QDragEnterEvent) -> None: if event.mimeData().hasUrls(): event.accept()
def dragEnterEvent(self, event: QDragEnterEvent): logger.debug('detected: {}'.format(event.mimeData().text())) event.accept()
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) -> None: if self.childAt(event.pos()) is self.label_drop_file: event.accept()