QWebEngineGlobalSettings Namespace

The QWebEngineGlobalSettings namespace holds global settings of the web engine. 更多...

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

(从 6.6 起) struct DnsMode

类型

enum class SecureDnsMode { SystemOnly, SecureWithFallback, SecureOnly }

函数

bool setDnsMode (QWebEngineGlobalSettings::DnsMode dnsMode )

详细描述

The QWebEngineGlobalSettings namespace holds global properties of the web engine.

援引 setDnsMode () to configure DNS-over-HTTPS.

另请参阅 QWebEngineGlobalSettings::setDnsMode ().

class DnsMode

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

类型文档编制

enum class QWebEngineGlobalSettings:: SecureDnsMode

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

常量 描述
QWebEngineGlobalSettings::SecureDnsMode::SystemOnly 0 This is the default. Use the system DNS host resolution.
QWebEngineGlobalSettings::SecureDnsMode::SecureWithFallback 1 Enable DNS-over-HTTPS (DoH). DoH servers have to be provided through serverTemplates DnsMode structure. If a host cannot be resolved via the provided servers, the system DNS host resolution is used.
QWebEngineGlobalSettings::SecureDnsMode::SecureOnly 2 Enable DNS-over-HTTPS and only allow hosts to be resolved this way. DoH servers have to be provided through serverTemplates DnsMode structure. If the DNS-over-HTTPS resolution fails, there is no fallback and the DNS host resolution fails completely.

函数文档编制

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

设置 dnsMode for DNS-over-HTTPS host resolution.

此函数返回 false 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.