QMacMime(3qt)
π QMacMime β like, the whole manual, but make it make sense π
ok bestie, gather round, because today we're talking about QMacMime from the Qt 3.3.8 era, page qmacmime.3qt π. she's a class, she maps open-standard MIME to Mac flavors, and honestly? she's doing the most so your drag-and-drop doesn't fall apart. let's get into it π¦
β¨ NAME β¨
QMacMime β Maps open-standard MIME to Mac flavors
πΈ SYNOPSIS πΈ
#include <qmime.h>
π Public Members
QMacMime ( char t )
virtual ~QMacMime ()
virtual const char * convertorName () = 0
virtual int countFlavors () = 0
virtual int flavor ( int index ) = 0
virtual bool canConvert ( const char * mime, int flav ) = 0
virtual const char * mimeFor ( int flav ) = 0
virtual int flavorFor ( const char * mime ) = 0
virtual QByteArray convertToMime ( QValueList<QByteArray> data, const
char * mime, int flav ) = 0
virtual QValueList<QByteArray> convertFromMime ( QByteArray data, const
char * mime, int flav ) = 0
π Static Public Members
QPtrList<QMacMime> all ( QMacMimeType t )
QMacMime * convertor ( QMacMimeType t, const char * mime, int flav )
const char * flavorToMime ( QMacMimeType t, int flav )
π DESCRIPTION π
The QMacMime class maps open-standard MIME to Mac flavors.
okay so here's the tea β β Qt's drag-and-drop and clipboard facilities use the MIME standard. On X11, this maps trivially to the Xdnd protocol, no drama, easy. But on Mac? not so simple bestie π some applications use MIME types to describe clipboard formats, and others use arbitrary non-standardized naming conventions, or just straight-up unnamed built-in Mac formats. it's giving chaos.
so the fix: by instantiating subclasses of QMacMime that provide conversions between Mac flavors and MIME formats, you can convert proprietary clipboard formats to MIME formats. slay π
Qt has predefined support for the following Mac flavors:
kScrapFlavorTypeUnicodeβ converted to"text/plain;charset=ISO-10646-UCS-2"and supported byQTextDrag.kScrapFlavorTypeTextβ converted to"text/plain;charset=system"or"text/plain"and supported byQTextDrag.kScrapFlavorTypePictureβ converted to"image/format", where format is a Qt image format, and supported byQImageDrag.kDragFlavorTypeHFSβ converted to"text/uri-list", and supported byQUriDrag.
You can check if a MIME type is convertible using canConvert() and can perform conversions with convertToMime() and convertFromMime(). π«Ά
See also Drag And Drop Classes, Input/Output and Networking, and Miscellaneous Classes.
π§ MEMBER FUNCTION DOCUMENTATION π§
QMacMime::QMacMime ( char t )
Constructs a new conversion object of type t, adding it to the globally accessed list of available convertors. new bestie just joined the group chat β¨
QMacMime::~QMacMime () [virtual]
Destroys a conversion object, removing it from the global list of available convertors. she said bye ππ
QPtrList<QMacMime> QMacMime::all ( QMacMimeType t ) [static]
Returns a list of all currently defined QMacMime objects of type t. the whole squad, accounted for π
bool QMacMime::canConvert ( const char * mime, int flav ) [pure virtual]
Returns TRUE if the convertor can convert (both ways) between mime and flav; otherwise returns FALSE.
All subclasses must reimplement this pure virtual function. no skipping, periodt π
QValueList<QByteArray> QMacMime::convertFromMime ( QByteArray data, const char * mime, int flav ) [pure virtual]
Returns data converted from MIME type mime to Mac flavor flav.
Note that Mac flavors must all be self-terminating. The return value may contain trailing data. π
All subclasses must reimplement this pure virtual function.
QByteArray QMacMime::convertToMime ( QValueList<QByteArray> data, const char * mime, int flav ) [pure virtual]
Returns data converted from Mac flavor flav to MIME type mime.
Note that Mac flavors must all be self-terminating. The input data may contain trailing data. π
All subclasses must reimplement this pure virtual function.
QMacMime * QMacMime::convertor ( QMacMimeType t, const char * mime, int flav ) [static]
Returns the most-recently created QMacMime of type t that can convert between the mime and flav formats. Returns 0 if no such convertor exists. fresh one only, bestie β newest wins
const char * QMacMime::convertorName () [pure virtual]
Returns a name for the convertor.
All subclasses must reimplement this pure virtual function. give her a name, she deserves one π
int QMacMime::countFlavors () [pure virtual]
Returns the number of Mac flavors supported by this convertor.
All subclasses must reimplement this pure virtual function.
int QMacMime::flavor ( int index ) [pure virtual]
Returns the Mac flavor supported by this convertor that is ordinarily at position index. This means that flavor(0) returns the first Mac flavor supported, and flavor(countFlavors()-1) returns the last. If index is out of range the return value is undefined. π watch your indices, fr fr
All subclasses must reimplement this pure virtual function.
int QMacMime::flavorFor ( const char * mime ) [pure virtual]
Returns the Mac flavor used for MIME type mime, or 0 if this convertor does not support mime.
All subclasses must reimplement this pure virtual function.
const char * QMacMime::flavorToMime ( QMacMimeType t, int flav ) [static]
Returns a MIME type of type t for flav, or 0 if none exists.
const char * QMacMime::mimeFor ( int flav ) [pure virtual]
Returns the MIME type used for Mac flavor flav, or 0 if this convertor does not support flav.
All subclasses must reimplement this pure virtual function.
π₯ SEE ALSO π₯
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. π
π AUTHOR π
Generated automatically from the source code. (yes, a robot wrote her, and she still ate π )
π BUGS π
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. π«Ά (bestie, good bug reports are literally the love language of maintainers)
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. not me reading the unofficial version anyway π
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qmacmime.3qt) and the Qt version (3.3.8). π
β and that's the whole page, no skips, no summaries, every flag and flavor accounted for. you're welcome π
Trolltech AS Β· 2 February 2007 Β· QMacMime(3qt) β ok that's the footer bestie, that's the whole vibe, go forth and convert some flavors πΈπ¦β¨
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms