Hello,
<div><br></div><div>I have been trying to do drag and drop of icons using MIMEdata class. in my code I have written:</div><div><br></div><div>image= event.mimeData().imageData(). Qt returns a QVariant type value after executing this statement <span class="Apple-style-span" style="text-decoration: underline;"><i>(<a href="http://doc.qt.nokia.com/qt-maemo-4.6/qmimedata.html#imageData">http://doc.qt.nokia.com/qt-maemo-4.6/qmimedata.html#imageData</a></i></span>). Thus image is a QVariant.</div>
<div><br></div><div><br></div><div>Now to get the imageData as QImage i need to use QVariant.value<QImage>() function like one below:</div><div><br></div><div>img= QtGui.QImage()</div><div>img= image.value<QImage>()</div>
<div><br></div><div>Here's the description: <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qvariant.html#qVariantValue">http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qvariant.html#qVariantValue</a></div>
<div><br></div><div><br></div><div>But the problem is that whenever I run this I get the following error:</div><div><br></div><div><div><span class="Apple-style-span" style="background-color: rgb(255, 0, 0);">img= image.value<QtGui.QImage>()</span></div>
<div><span class="Apple-style-span" style="background-color: rgb(255, 0, 0);">AttributeError: 'QVariant' object has no attribute 'value'</span></div><div><br></div><div><br></div><div>Please tell me what is the reason for this error. kindly help me on this.</div>
<div><br></div><div><br></div><div>Regards</div><div>Anshul</div></div>