diff --git a/src/gui/platform/darwin/qmacmimeregistry.mm b/src/gui/platform/darwin/qmacmimeregistry.mm index acbe671e1a..6710a0656f 100644 --- a/src/gui/platform/darwin/qmacmimeregistry.mm +++ b/src/gui/platform/darwin/qmacmimeregistry.mm @@ -21,20 +21,6 @@ Q_GLOBAL_STATIC(QStringList, globalDraggedTypesList) // implemented in qutimimeconverter.mm void registerBuiltInTypes(); -/*! - \fn void qRegisterDraggedTypes(const QStringList &types) - \relates QUtiMimeConverter - - Registers the given \a types as custom pasteboard types. - - This function should be called to enable the Drag and Drop events - for custom pasteboard types on Cocoa implementations. This is required - in addition to a QUtiMimeConverter subclass implementation. By default - drag and drop is enabled for all standard pasteboard types. - - \sa QUtiMimeConverter -*/ - void registerDraggedTypes(const QStringList &types) { (*globalDraggedTypesList()) += types; diff --git a/src/gui/platform/darwin/qutimimeconverter.mm b/src/gui/platform/darwin/qutimimeconverter.mm index 975f00cf88..6a4f80a8d7 100644 --- a/src/gui/platform/darwin/qutimimeconverter.mm +++ b/src/gui/platform/darwin/qutimimeconverter.mm @@ -53,7 +53,21 @@ using namespace Qt::StringLiterals; 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 QUtiMimeConverter will automatically be registered, and active, upon instantiation. + Construct an instance of your converter implementation after instantiating + QGuiApplication: + + \code + int main(int argc, char **argv) + { + QGuiApplication app(argc, argv); + JsonMimeConverter jsonConverter; + } + \endcode + + Destroying the instance will unregister the converter and remove support + for the conversion. It is also valid to heap-allocate the converter + instance; Qt takes ownership and will delete the converter object during + QGuiApplication shut-down. Qt has predefined support for the following UTIs: \list @@ -94,6 +108,8 @@ QUtiMimeConverter::QUtiMimeConverter(HandlerScope scope) /*! Constructs a new conversion object and adds it to the globally accessed list of available converters. + + Call this constructor after QGuiApplication has been created. */ QUtiMimeConverter::QUtiMimeConverter() : QUtiMimeConverter(HandlerScopeFlag::All) diff --git a/src/gui/platform/windows/qwindowsmimeconverter.cpp b/src/gui/platform/windows/qwindowsmimeconverter.cpp index d7998a3eb7..49d524cb99 100644 --- a/src/gui/platform/windows/qwindowsmimeconverter.cpp +++ b/src/gui/platform/windows/qwindowsmimeconverter.cpp @@ -25,6 +25,22 @@ QT_BEGIN_NAMESPACE conversions between Windows Clipboard and MIME formats, you can convert proprietary clipboard formats to MIME formats. + Construct an instance of your converter implementation after instantiating + QGuiApplication: + + \code + int main(int argc, char **argv) + { + QGuiApplication app(argc, argv); + JsonMimeConverter jsonConverter; + } + \endcode + + Destroying the instance will unregister the converter and remove support + for the conversion. It is also valid to heap-allocate the converter + instance; Qt takes ownership and will delete the converter object during + QGuiApplication shut-down. + Qt has predefined support for the following Windows Clipboard formats: \table @@ -112,6 +128,8 @@ QT_BEGIN_NAMESPACE The instance is automatically registered, and will be called to convert data during clipboard or drag'n'drop operations. + + Call this constructor after QGuiApplication has been created. */ QWindowsMimeConverter::QWindowsMimeConverter() {