Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_gui_util_qdesktopservices.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3#include <QDesktopServices>
4#include <QObject>
5#include <QStandardPaths>
6#include <QUrl>
7
9
10//! [0]
11class MyHelpHandler : public QObject
12{
14public:
15 // ...
16public slots:
17 void showHelp(const QUrl &url);
18};
19//! [0]
20
21void wrapper0() {
22MyHelpHandler *helpInstance = nullptr;
23//! [setUrlHandler]
24QDesktopServices::setUrlHandler("help", helpInstance, "showHelp");
25//! [setUrlHandler]
26} // wrapper
27
28
29/* comment wrapper 1
30
31//! [1]
32mailto:user@foo.com?subject=Test&body=Just a test
33//! [1]
34
35*/ // comment wrapper 1
36
37
38void wrapper1() {
39//! [2]
40QDesktopServices::openUrl(QUrl("file:///C:/Program Files", QUrl::TolerantMode));
41//! [2]
42}
43
44
45/* comment wrapper 2
46
47//! [3]
48<key>LSApplicationQueriesSchemes</key>
49<array>
50 <string>https</string>
51</array>
52//! [3]
53
54//! [4]
55<key>CFBundleURLTypes</key>
56<array>
57 <dict>
58 <key>CFBundleURLSchemes</key>
59 <array>
60 <string>myapp</string>
61 </array>
62 </dict>
63</array>
64//! [4]
65
66*/ // comment wrapper 2
67
68/* comment wrapper 3
69//! [7]
70<key>com.apple.developer.associated-domains</key>
71<array>
72 <string>applinks:your.domain.com</string>
73</array>
74//! [7]
75
76//! [8]
77{
78 "applinks": {
79 "apps": [],
80 "details": [{
81 "appIDs" : [ "ABCDE12345.com.example.app" ],
82 "components": [{
83 "/": "/help",
84 "?": { "topic": "?*"}
85 }]
86 }]
87 }
88}
89//! [8]
90
91//! [9]
92<intent-filter>
93 <action android:name="android.intent.action.VIEW" />
94 <category android:name="android.intent.category.DEFAULT" />
95 <category android:name="android.intent.category.BROWSABLE" />
96 <data android:scheme="https" android:host="your.domain.com" android:port="1337" android:path="/help"/>
97</intent-filter>
98//! [9]
99
100//! [10]
101<intent-filter android:autoVerify="true">
102//! [10]
103
104//! [11]
105[{
106 "relation": ["delegate_permission/common.handle_all_urls"],
107 "target": {
108 "namespace": "android_app",
109 "package_name": "com.example.app",
110 "sha256_cert_fingerprints":
111 ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
112 }
113}]
114//! [11]
115
116*/ // comment wrapper 3
117
118} // src_gui_util_qdesktopservices