def dragEnterEvent(self, event: QtGui.QDragEnterEvent): # accept url lists (files by drag and drop) for url in event.mimeData().urls(): if str(url.toString()).strip().endswith(".npz"): event.accept() return event.ignore()
def dragEnterEvent(self, event: QtGui.QDragEnterEvent): # accept url lists (files by drag and drop) for url in event.mimeData().urls(): url = QUrl2PythonPath(url) if url.is_dir() or url.suffix == ".tif": event.accept() return event.ignore()
def dragEnterEvent(self, event: QtGui.QDragEnterEvent): # accept url lists (files by drag and drop) if event.mimeData().hasFormat("text/uri-list"): event.accept() else: event.ignore()