QWebEngineGlobalSettings Namespace

The QWebEngineGlobalSettings namespace holds global settings of the web engine. More...

Header: #include <QWebEngineGlobalSettings>
CMake: find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)
target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)
qmake: QT += webenginecore
Since: Qt 6.6


struct DnsMode


enum class SecureDnsMode { SystemOnly, SecureWithFallback, SecureOnly }


bool setDnsMode(QWebEngineGlobalSettings::DnsMode dnsMode)

Detailed Description

The QWebEngineGlobalSettings namespace holds global properties of the web engine.

Invoke setDnsMode() to configure DNS-over-HTTPS.

See also QWebEngineGlobalSettings::setDnsMode().


class DnsMode

The DnsMode struct provides means to specify the DNS host resolution mode. More...

Type Documentation

enum class QWebEngineGlobalSettings::SecureDnsMode

This enum sets the DNS-over-HTTPS mode used by the DnsMode structure:

QWebEngineGlobalSettings::SecureDnsMode::SystemOnly0This is the default. Use the system DNS host resolution.
QWebEngineGlobalSettings::SecureDnsMode::SecureWithFallback1Enable DNS-over-HTTPS (DoH). DoH servers have to be provided through serverTemplates in the DnsMode structure. If a host cannot be resolved via the provided servers, the system DNS host resolution is used.
QWebEngineGlobalSettings::SecureDnsMode::SecureOnly2Enable DNS-over-HTTPS and only allow hosts to be resolved this way. DoH servers have to be provided through serverTemplates in the DnsMode structure. If the DNS-over-HTTPS resolution fails, there is no fallback and the DNS host resolution fails completely.

Function Documentation

bool QWebEngineGlobalSettings::setDnsMode(QWebEngineGlobalSettings::DnsMode dnsMode)

Sets dnsMode for DNS-over-HTTPS host resolution.

This function returns false if the serverTemplates list in the DnsMode structure is empty or contains URI templates that cannot be parsed for SecureDnsMode::SecureOnly or SecureDnsMode::SecureWithFallback. Otherwise, it returns true meaning that the DNS mode change is triggered.

© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.