Пример #1
0
 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()
Пример #2
0
 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()
Пример #3
0
 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()
Пример #4
0
 def dragEnterEvent(self, event: QDragEnterEvent):
     if event.mimeData().hasFormat("application/x_nodepath.list"):
         event.acceptProposedAction()
Пример #5
0
 def dragEnterEvent(self, event: QDragEnterEvent):
     if event.mimeData().hasFormat("application/x_nodepath.list"):
         event.acceptProposedAction()
Пример #6
0
 def dragEnterEvent(self, event: QtGui.QDragEnterEvent):
     if event.mimeData().objectName() == 'frame':
         event.accept()
Пример #7
0
 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()
Пример #8
0
 def dragEnterEvent(self, event: QDragEnterEvent):  # pylint: disable=R0201
     if event.mimeData().hasUrls():
         event.acceptProposedAction()
Пример #9
0
 def dragEnterEvent(self, event: QDragEnterEvent):  # pylint: disable=R0201
     if event.mimeData().hasFormat("text/plain"):
         event.acceptProposedAction()