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 ().
The DnsMode struct provides means to specify the DNS host resolution mode. 更多...
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. |
设置 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.