Example #1
0
 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()
Example #2
0
 def dragEnterEvent(self, event: QtGui.QDragEnterEvent):
     event.accept()
Example #3
0
 def dragEnterEvent(self, event: QtGui.QDragEnterEvent) -> None:
     if event.mimeData().hasUrls():
         event.accept()
Example #4
0
 def dragEnterEvent(self, event: QDragEnterEvent):
     logger.debug('detected: {}'.format(event.mimeData().text()))
     event.accept()
Example #5
0
    def dragEnterEvent(self, event: QtGui.QDragEnterEvent):

        if event.mimeData().hasFormat("text/plain") and self.drag:
            event.accept()
        else:
            event.ignore()
Example #6
0
 def dragEnterEvent(self, event: QDragEnterEvent) -> None:
     if self.childAt(event.pos()) is self.label_drop_file:
         event.accept()