Details
-
Suggestion
-
Resolution: Invalid
-
P3: Somewhat important
-
4.6.3, 4.7.0
-
None
-
Mac OS X Cocoa
Description
Our application is using QDrag object with overridden QMimeData object. we have overridden formats() and retrieveData() operations of QMimeData to return media(image) data from our custom MimeData object. However this retrieveData operation is expensive for large sized files.
Overridden MimeData object sample code:
QStringList CustomMimeData::formats() const
{
QStringList list = QMimeData::formats();
if (hasImageUrls())
list << "application/x-qt-image";
return list;
}
QVariant CustomMimeData::retrieveData(const QString & mimetype, QVariant::Type type) const
{
if (mimetype == "application/x-qt-image")
{
//Expensive call. Retrieves image data
}
else
return QMimeData::retrieveData(mimetype, type);;
}
Problem here is that Qt drag operation is trying to retrieve the data even though it only works on urls of the object. This is affecting performance of drag operations with in our applications.
It would be good if this could be changed to not retrieve the data until its needed. Possibly changed in QMacPasteboard::setMimeData(QMimeData *mime_src) .