papercut87
20th April 2015, 10:42
Hi All,
I'm not able to do this simple action.
I have an application that interact with an usb device and, in a special tab, i show to the user a listview that present a special directory of that device.
At some point, i want to let the user drag a file(s) from the device(from the listview) to the desktop(or wherever he wants).
I tryed to use the DelayedEncoding example http://doc.qt.digia.com/4.6/draganddrop-delayedencoding.html from QT 4.6 but, for my custom file, seems not work. when i drop the file to desktop nothing happen.
The function:
void SourceWidget::createData(const QString &mimeType)
{
if ( mimeType != "application/x-delayedencoding" )
return;
mimeData->setData( "application/x-delayedencoding", imageData );
}
is never called from the MimeData function
QVariant retrieveData(const QString &mimetype, QVariant::Type type) const;
I think the problem is the creation of the mime data object, but i'm not able to understand what i have to do for insert information like mime data and mime type for my custom files.
Thanks in advace, for any help or suggestion.
I'm not able to do this simple action.
I have an application that interact with an usb device and, in a special tab, i show to the user a listview that present a special directory of that device.
At some point, i want to let the user drag a file(s) from the device(from the listview) to the desktop(or wherever he wants).
I tryed to use the DelayedEncoding example http://doc.qt.digia.com/4.6/draganddrop-delayedencoding.html from QT 4.6 but, for my custom file, seems not work. when i drop the file to desktop nothing happen.
The function:
void SourceWidget::createData(const QString &mimeType)
{
if ( mimeType != "application/x-delayedencoding" )
return;
mimeData->setData( "application/x-delayedencoding", imageData );
}
is never called from the MimeData function
QVariant retrieveData(const QString &mimetype, QVariant::Type type) const;
I think the problem is the creation of the mime data object, but i'm not able to understand what i have to do for insert information like mime data and mime type for my custom files.
Thanks in advace, for any help or suggestion.