diff options
Diffstat (limited to 'src/gui/util/qdesktopservices.cpp')
-rw-r--r-- | src/gui/util/qdesktopservices.cpp | 44 |
1 files changed, 7 insertions, 37 deletions
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index 4a12f6db6f..7ca138b1b7 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -18,8 +18,6 @@ #include <qpa/qplatformintegration.h> #include <qdir.h> -#include <QtCore/private/qlocking_p.h> - QT_BEGIN_NAMESPACE class QOpenUrlHandlerRegistry @@ -36,36 +34,10 @@ public: }; typedef QHash<QString, Handler> HandlerHash; HandlerHash handlers; - -#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0) - QObject context; - - void handlerDestroyed(QObject *handler); -#endif - }; Q_GLOBAL_STATIC(QOpenUrlHandlerRegistry, handlerRegistry) -#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0) -void QOpenUrlHandlerRegistry::handlerDestroyed(QObject *handler) -{ - const auto lock = qt_scoped_lock(mutex); - HandlerHash::Iterator it = handlers.begin(); - while (it != handlers.end()) { - if (it->receiver == handler) { - it = handlers.erase(it); - qWarning("Please call QDesktopServices::unsetUrlHandler() before destroying a " - "registered URL handler object.\n" - "Support for destroying a registered URL handler object is deprecated, " - "and will be removed in Qt 6.6."); - } else { - ++it; - } - } -} -#endif - /*! \class QDesktopServices \brief The QDesktopServices class provides methods for accessing common desktop services. @@ -238,10 +210,12 @@ bool QDesktopServices::openUrl(const QUrl &url) the destruction of the handler object does not overlap with concurrent invocations of openUrl() using it. - \section1 iOS + \target configuring qdesktopservices url handler on ios and macos + \section1 iOS and \macos - To use this function for receiving data from other apps on iOS you also need to - add the custom scheme to the \c CFBundleURLSchemes list in your Info.plist file: + To use this function for receiving data from other apps on iOS/\macos + you also need to add the custom scheme to the \c CFBundleURLSchemes + list in your Info.plist file: \snippet code/src_gui_util_qdesktopservices.cpp 4 @@ -256,7 +230,7 @@ bool QDesktopServices::openUrl(const QUrl &url) \snippet code/src_gui_util_qdesktopservices.cpp 7 - iOS will search for /.well-known/apple-app-site-association on your domain, + iOS/\macos will search for /.well-known/apple-app-site-association on your domain, when the application is installed. If you want to listen to \c{https://your.domain.com/help?topic=ABCDEF} you need to provide the following content there: @@ -266,6 +240,7 @@ bool QDesktopServices::openUrl(const QUrl &url) For more information, see the Apple Developer Documentation for \l {iOS: Supporting Associated Domains}{Supporting Associated Domains}. + \target configuring qdesktopservices url handler on android \section1 Android To use this function for receiving data from other apps on Android, you @@ -306,11 +281,6 @@ void QDesktopServices::setUrlHandler(const QString &scheme, QObject *receiver, c h.receiver = receiver; h.name = method; registry->handlers.insert(scheme.toLower(), h); -#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0) - QObject::connect(receiver, &QObject::destroyed, ®istry->context, - [registry](QObject *obj) { registry->handlerDestroyed(obj); }, - Qt::DirectConnection); -#endif } /*! |