I am trying to set up an application that will accept havin files dropped into it. So, I am looking for a way to extract the path when they are dropped in.
Right
The QMimeData class has methods for dealing with dropped urls
:
def dragEnterEvent(self, event):
if event.mimeData().hasUrls():
event.accept()
else:
event.ignore()
def dropEvent(self, event):
for url in event.mimeData().urls():
path = url.toLocalFile().toLocal8Bit().data()
if os.path.isfile(path):
print path
# do other stuff with path...