diff options
author | David Faure <david.faure@kdab.com> | 2014-11-05 16:53:46 +0100 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2014-11-13 19:21:06 +0100 |
commit | efbc53858725ec8563bb97423d9bf789c41cf79f (patch) | |
tree | 09d64bc8fcf528c7656c3689f4cb70098a102760 /src/corelib/kernel | |
parent | 4c1ea8f72ce806a5059ddec1ec1364f9a92294f0 (diff) |
qwindowsmime.cpp: support dropping multiple mail attachments
Only the data for the first file could be reached with the mimetype
application/x-qt-windows-mime;value="FileContents"
To get the data for the other files, setting the lindex field of
the FORMATETC struct is necessary. Provide support for that by
appending ;index=N to the mimetype string.
The Windows API provides no generic way to find out how many of these
are available (the app has to find out by looking into the FILEGROUPDESCRIPTORW
structure, for this particular use case), so these additional mimetypes
are not listed in QMimeData::formats(). However this patch extends
the documentation to mention the feature.
[ChangeLog][Platform Specific Changes][Windows][QMimeData] Add support
for handling dropping of multiple mail attachments, adding ;index=N to
the mimetype string application/x-qt-windows-mime;value="FileContents"
Task-number: QTBUG-17373
Change-Id: I031e477d2357b4e5135d2dcd3e3cf991025715a5
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qmimedata.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmimedata.cpp b/src/corelib/kernel/qmimedata.cpp index 15fdf57747..45aec88429 100644 --- a/src/corelib/kernel/qmimedata.cpp +++ b/src/corelib/kernel/qmimedata.cpp @@ -286,6 +286,11 @@ QVariant QMimeDataPrivate::retrieveTypedData(const QString &format, QVariant::Ty The \c value declaration of each format describes the way in which the data is encoded. + In some cases (e.g. dropping multiple email attachments), multiple data + values are available. They can be accessed by adding an \c index value: + + \snippet code/src_corelib_kernel_qmimedata.cpp 8 + On Windows, the MIME format does not always map directly to the clipboard formats. Qt provides QWinMime to map clipboard formats to open-standard MIME formats. Similarly, the |