On Fri, 2 Apr 2010 15:23:31 +0530, Anshul Jain <[email protected]> wrote: > Hello, > > I have been trying to do drag and drop of icons using MIMEdata class. in my > code I have written: > > image= event.mimeData().imageData(). Qt returns a QVariant type value > after > executing this statement *( > http://doc.qt.nokia.com/qt-maemo-4.6/qmimedata.html#imageData*). Thus image > is a QVariant. > > > Now to get the imageData as QImage i need to use QVariant.value<QImage>() > function like one below: > > img= QtGui.QImage() > img= image.value<QImage>() > > Here's the description: > http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qvariant.html#qVariantValue > > > But the problem is that whenever I run this I get the following error: > > img= image.value<QtGui.QImage>() > AttributeError: 'QVariant' object has no attribute 'value' > > > Please tell me what is the reason for this error. kindly help me on this.
Python isn't C++ - try... img = QImage(image) Phil _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
