I am using PyQt4, Python 2.7, Qt 4.8 on Mac OSX Yosmite. I appear to have Drag-n-Drop working, can process drop event etc. If I drop a file in and print the path I get values like /.file/id=6571367.11512812
Using this file-id I can't seem to open/process the file.
Here is the dropEvent() method. Any ideas how to get the true file path?
def dropEvent(self, event):
for url in event.mimeData().urls():
path = url.path() # also tried url.toLocalFile().toLocal8Bit().data()
print path
if os.path.isfile(path):
print "found"
else:
print "not found"
It seems to be related to https://bugreports.qt.io/browse/QTBUG-40449 which recommends upgrading to Qt5, which is will require a significant effort as I have vtk5, opencv, qgis and few others dependent on Qt4.
Anyone know of a workaround or a fix?