[PyQt] Dropping image icon

Filip Gruszczyński gruszczy at gmail.com
Sun Dec 7 23:17:07 GMT 2008

I am trying to allowing dropping images' icons into my app, from which
information about the image will be retrieved. I checked all MIME
formats of the icon drop and tried to
retrieve the associated data, but all of it was empty strings:

	def dragEnterEvent(self, event):
		for format in event.mimeData().formats():
			data = event.mimeData().data(format)
			stream = QDataStream(data, QIODevice.ReadOnly)
			text = QString()
			stream >> text
			print text

The only thing I need is path to the file represented by this icon,
but I fail to get this. Could you point me, from where I can get it?

Filip Gruszczyński

More information about the PyQt mailing list