Hello,<br>I've found this code snippet in PyQt eample for drag and drop of images. Can anyone plz help me out in understanding this code snippet. I am new to this.<br><br><br>child = self.childAt(event.pos())<br> if not child:<br>
return<br><br> pixmap = QtGui.QPixmap(child.pixmap())<br><br> itemData = QtCore.QByteArray()<br> dataStream = QtCore.QDataStream(itemData, QtCore.QIODevice.WriteOnly)<br> dataStream << pixmap << QtCore.QPoint(event.pos() - child.pos())<br>
<br> mimeData = QtCore.QMimeData()<br> mimeData.setData('application/x-dnditemdata', itemData)<br><br> drag = QtGui.QDrag(self)<br> drag.setMimeData(mimeData)<br> drag.setPixmap(pixmap)<br>
drag.setHotSpot(event.pos() - child.pos())<br> tempPixmap = QtGui.QPixmap(pixmap)<br> painter = QtGui.QPainter()<br> painter.begin(tempPixmap)<br> painter.fillRect(pixmap.rect(), QtGui.QColor(127, 127, 127, 127))<br>
painter.end()<br><br><br>Also, what does 'x-dnditemdata' mean in the line: event.mimeData().hasFormat('application/x-dnditemdata')<br>I'll be really grateful if someone can help me out with this.<br>
<br>Regrards<br>Anshul<br>