QMacPasteboardMime Class
The QMacPasteboardMime class converts between a MIME type and a Uniform Type Identifier (UTI) format. More...
| Header: | #include <QMacPasteboardMime> |
| qmake: | QT += macextras |
| Since: | Qt 5.2 |
This class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
This class was introduced in Qt 5.2.
Detailed Description
Qt's drag and drop and clipboard facilities use the MIME standard. On X11, this maps trivially to the Xdnd protocol. On Mac, although some applications use MIME to describe clipboard contents, it is more common to use Apple's UTI format.
QMacPasteboardMime's role is to bridge the gap between MIME and UTI; By subclasses this class, one can extend Qt's drag and drop and clipboard handling to convert to and from unsupported, or proprietary, UTI formats.
A subclass of QMacPasteboardMime will automatically be registered, and active, upon instantiation.
Qt has predefined support for the following UTIs:
| UTI | Converts to |
|---|---|
public.utf8-plain-text | text/plain |
public.utf16-plain-text | text/plain |
public.html | text/html |
public.url | text/uri-list |
public.file-url | text/uri-list |
public.tiff | application/x-qt-image |
public.vcard | text/plain |
com.apple.traditional-mac-plain-text | text/plain |
com.apple.pict | application/x-qt-image |
When working with MIME data, Qt will interate through all instances of QMacPasteboardMime to find an instance that can convert to, or from, a specific MIME type. It will do this by calling canConvert() on each instance, starting with (and choosing) the last created instance first. The actual conversions will be done by using convertToMime() and convertFromMime().
Note: The API uses the term "flavor" in some cases. This is for backwards compatibility reasons, and should now be understood as UTIs.