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: QDragEnterEvent) -> None: """Drag file in to our window.""" mime_data: QMimeData = event.mimeData() if not mime_data.hasUrls(): return urls = mime_data.urls() if len(urls) == 1: suffix = QFileInfo(urls[0].toLocalFile()).suffix().lower() if suffix in {'yml', 'pyslvs', 'slvs'} | set(qt_image_suffix): event.acceptProposedAction()
def dragEnterEvent(self, event: QDragEnterEvent): if event.mimeData().hasFormat("application/x_nodepath.list"): event.acceptProposedAction()
def dragEnterEvent(self, event: QtGui.QDragEnterEvent): if event.mimeData().objectName() == 'frame': event.accept()
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()
def dragEnterEvent(self, event: QDragEnterEvent): # pylint: disable=R0201 if event.mimeData().hasUrls(): event.acceptProposedAction()
def dragEnterEvent(self, event: QDragEnterEvent): # pylint: disable=R0201 if event.mimeData().hasFormat("text/plain"): event.acceptProposedAction()