class DropableQLabel(QtGui.QLabel):
def __init__(self, parent):
super(DropableQLabel, self).__init__(parent)
self.skalman = parent.skalman
self.skalman.browser = parent
self.setFixedWidth(300)
self.setFixedHeight(169)
self.setFrameShape(QtGui.QFrame.Box)
self.setAlignment(QtCore.Qt.AlignCenter)
self.setAcceptDrops(True)
def dragEnterEvent(self, event):
print 'Entered droppable area'
if event.mimeData().hasUrls():
event.acceptProposedAction()
else:
super(DropableQLabel, self).dragEnterEvent(event)
def dropEvent(self, event):
if event.mimeData().hasUrls():
for url in event.mimeData().urls():
print url.path() # this is not always an absolute filepath
event.acceptProposedAction()
else:
super(DropableQLabel,self).dropEvent(event)
I don't recall there being too much variation in the way you retrieve the path of a dropped file. You just check for the urls, and for text. It's up to the underlying platform specific code to deliver the mime info as part of its drop.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWP6rn%2B6-A8dd4p1TA6gRu3FSDw%2Bc5vWsfJ1gmfOUUWdmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0xf%3DG42_%3D%3DHo8YisEH%2Bg4DmDEpx%2BNNnbEVAVySp%2B7DOw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWMxSmGwRmUqdK7XdD2h7ryRn4rgEM-dX60mv9B3p1fGng%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWP6rn%2B6-A8dd4p1TA6gRu3FSDw%2Bc5vWsfJ1gmfOUUWdmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0xf%3DG42_%3D%3DHo8YisEH%2Bg4DmDEpx%2BNNnbEVAVySp%2B7DOw%40mail.gmail.com.--
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWMxSmGwRmUqdK7XdD2h7ryRn4rgEM-dX60mv9B3p1fGng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2CGJve8MCjqx8S%3DEHemajOWFysYtMj4Y24uL5j3YzCwQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWP3knkKCWDH_m08fAUzcZgh3wF4OhYFO9khXo7p6%2B7H5Q%40mail.gmail.com.
def dropEvent(self, event):
if event.mimeData().hasUrls():
for url in event.mimeData().urls():
print url.host()
print url.path()
return url.host()+url.path() # absolute filepath for UNC/Windows
event.acceptProposedAction()
else:
super(DropableQLabel,self).dropEvent(event)
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3-LAYBzSAdj9z4vh261PpgVw2QvBT8ywVriR17%3DmUeRQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWP6rn%2B6-A8dd4p1TA6gRu3FSDw%2Bc5vWsfJ1gmfOUUWdmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0xf%3DG42_%3D%3DHo8YisEH%2Bg4DmDEpx%2BNNnbEVAVySp%2B7DOw%40mail.gmail.com.--
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWMxSmGwRmUqdK7XdD2h7ryRn4rgEM-dX60mv9B3p1fGng%40mail.gmail.com.--
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2CGJve8MCjqx8S%3DEHemajOWFysYtMj4Y24uL5j3YzCwQ%40mail.gmail.com.--
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWP3knkKCWDH_m08fAUzcZgh3wF4OhYFO9khXo7p6%2B7H5Q%40mail.gmail.com.
--
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWP3knkKCWDH_m08fAUzcZgh3wF4OhYFO9khXo7p6%2B7H5Q%40mail.gmail.com.
--
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.