path: root/examples
diff options
authorJüri Valdmann <>2018-09-03 10:25:04 +0200
committerJüri Valdmann <>2018-09-12 09:53:53 +0000
commit5b5b7d9a5f922ef5fa99cfac41da348e23970032 (patch)
tree52369f7ff008d64a6089a0d8063189f396761b99 /examples
parentc91bba7af3215107916a135733dcf428f57a564f (diff)
Improve QWebEngineUrlScheme API
Following feedback from 5.12 API review: - Use enum class for Syntax - Add Q_FLAG for Flags - Mark constructor from name as explicit - Rename Secure to SecureScheme - Rename Local to LocalScheme - Rename addScheme to registerScheme - Rename findScheme to schemeByName Task-number: QTBUG-70247 Change-Id: Iae332c8d9843349506e8a4b07d70f0d234597375 Reviewed-by: Allan Sandfeld Jensen <>
Diffstat (limited to 'examples')
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/webenginewidgets/webui/doc/src/webui.qdoc b/examples/webenginewidgets/webui/doc/src/webui.qdoc
index d5eb13d0..47d9fbad 100644
--- a/examples/webenginewidgets/webui/doc/src/webui.qdoc
+++ b/examples/webenginewidgets/webui/doc/src/webui.qdoc
@@ -84,7 +84,7 @@
In order to take advantage of these possibilities, the custom scheme must
first be registered. This means creating and configuring a \l
{QWebEngineUrlScheme} object and then handing it over to \l
- {QWebEngineUrlScheme::addScheme()}. The example program does exactly this in
+ {QWebEngineUrlScheme::registerScheme()}. The example program does exactly this in
the static method \c {WebUiHandler::registerUrlScheme()}:
\quotefromfile webenginewidgets/webui/webuihandler.cpp
@@ -95,11 +95,11 @@
the constructor of \c {QWebEngineUrlScheme} or by calling \l
{QWebEngineUrlScheme::setName}. In the above, the name \c {webui} is set
through the constructor. Additionally, we activate the flags \l
- {QWebEngineUrlScheme::Secure}{Secure}, \l
- {QWebEngineUrlScheme::Local}{Local} and \l
+ {QWebEngineUrlScheme::SecureScheme}{SecureScheme}, \l
+ {QWebEngineUrlScheme::LocalScheme}{LocalScheme} and \l
{QWebEngineUrlScheme::LocalAccessAllowed}{LocalAccessAllowed}. Since our
custom scheme handler will not deliver resources received from insecure
- network connections, we can safely mark it as \c {Secure}. The \c {Local}
+ network connections, we can safely mark it as a \c {SecureScheme}. The \c {LocalScheme}
flag prevents content from non-local schemes (such as \c {http}) from
interacting with our custom scheme. Without this flag it would be possible,
for example, to embed the \c {webui:about} page in an \c <iframe> element on
diff --git a/examples/webenginewidgets/webui/webuihandler.cpp b/examples/webenginewidgets/webui/webuihandler.cpp
index 246af9d0..63c24936 100644
--- a/examples/webenginewidgets/webui/webuihandler.cpp
+++ b/examples/webenginewidgets/webui/webuihandler.cpp
@@ -91,8 +91,8 @@ void WebUiHandler::requestStarted(QWebEngineUrlRequestJob *job)
void WebUiHandler::registerUrlScheme()
QWebEngineUrlScheme webUiScheme(schemeName);
- webUiScheme.setFlags(QWebEngineUrlScheme::Secure |
- QWebEngineUrlScheme::Local |
+ webUiScheme.setFlags(QWebEngineUrlScheme::SecureScheme |
+ QWebEngineUrlScheme::LocalScheme |
- QWebEngineUrlScheme::addScheme(webUiScheme);
+ QWebEngineUrlScheme::registerScheme(webUiScheme);