6#include <QtCore/qurl.h>
7#include <QtCore/qdebug.h>
8#include <QtCore/private/qcore_mac_p.h>
9#include <QtCore/qscopedvaluerollback.h>
11#include <QtGui/qdesktopservices.h>
13#import <UIKit/UIApplication.h>
20 qWarning() <<
"openUrl not implement for application extensions yet";
25 if (
url == m_handlingUrl)
31 NSURL *nsUrl =
url.toNSURL();
34 if (![application canOpenURL:nsUrl])
37 static SEL openUrlSelector =
@selector(openURL:options:completionHandler:);
38 NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:
39 [UIApplication instanceMethodSignatureForSelector:openUrlSelector]];
40 invocation.target = application;
41 invocation.selector = openUrlSelector;
43 static auto kEmptyDictionary = @{};
45 [invocation setArgument:&nsUrl atIndex:2];
46 [invocation setArgument:&kEmptyDictionary atIndex:3];
static bool openUrl(const QUrl &url)
Opens the given url in the appropriate Web browser for the user's desktop environment,...
bool openUrl(const QUrl &url)
bool openDocument(const QUrl &url)
bool handleUrl(const QUrl &url)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString scheme() const
Returns the scheme of the URL.
Combined button and popup list for selecting options.
bool qt_apple_isApplicationExtension()
AppleApplication * qt_apple_sharedApplication()
QUrl url("example.com")
[constructor-url-reference]