6#ifndef QT_NO_DESKTOPSERVICES
14#include <private/qguiapplication_p.h>
17#include <qpa/qplatformservices.h>
18#include <qpa/qplatformintegration.h>
150 static bool insideOpenUrlHandler =
false;
152 if (!insideOpenUrlHandler) {
155 insideOpenUrlHandler =
true;
157 insideOpenUrlHandler =
false;
168 qWarning(
"QDesktopServices::openUrl: Please instantiate the QGuiApplication object "
170 else if (
Q_UNLIKELY(!qobject_cast<QGuiApplication *>(application)))
171 qWarning(
"QDesktopServices::openUrl: Application is not a GUI application");
176 if (!platformServices) {
177 qWarning(
"The platform plugin does not support services.");
183 return platformServices->openDocument(
url);
184 return platformServices->openUrl(
url);
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
The QDesktopServices class provides methods for accessing common desktop services.
static void unsetUrlHandler(const QString &scheme)
Removes a previously set URL handler for the specified scheme.
static void setUrlHandler(const QString &scheme, QObject *receiver, const char *method)
Sets the handler for the given scheme to be the handler method provided by the receiver object.
static QPlatformIntegration * platformIntegration()
bool remove(const Key &key)
Removes the item that has the key from the hash.
const_iterator constFind(const Key &key) const noexcept
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
const_iterator ConstIterator
Qt-style synonym for QHash::const_iterator.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QHash< QString, Handler > HandlerHash
QOpenUrlHandlerRegistry()=default
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString toLower() const &
bool isValid() const
Returns true if the URL is non-empty and valid; otherwise returns false.
QString scheme() const
Returns the scheme of the URL.
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
#define Q_ARG(Type, data)
GLfloat GLfloat GLfloat GLfloat h
QUrl url("example.com")
[constructor-url-reference]