"PyQt6.QtWebEngineCore.QWebEngineGlobalSettings.setDnsMode" missing method?

Charles peacech at gmail.com
Thu Feb 15 15:52:52 GMT 2024


It is printed regardless of the dns mode.

To hide the message you can set env `set QT_LOGGING_RULES="*.debug=false"`
or call setFilterRules as written in
https://doc.qt.io/qt-6/qloggingcategory.html.

I have checked that setting QT_LOGGING_RULES did remove the doh message in
my qwebengine app.

On Thu, Feb 15, 2024 at 10:36 PM Matic Kukovec <kukovecmatic at hotmail.com>
wrote:

> Hi,
>
> Specs:
>
>    - Windows 10 x64
>    - Python 3.12 x64
>    - PyQt 6.6.1
>    - QWebEngine 6.6.0
>
>
>
> Running this code:
> import PyQt6.QtWebEngineCore
> dns_mode = PyQt6.QtWebEngineCore.QWebEngineGlobalSettings.DnsMode()
> dns_mode.secureMode =
> PyQt6.QtWebEngineCore.QWebEngineGlobalSettings.SecureDnsMode.SystemOnly
> PyQt6.QtWebEngineCore.QWebEngineGlobalSettings.setDnsMode(dns_mode)
>
> ... throws this error:
> AttributeError: type object 'QWebEngineGlobalSettings' has no attribute
> 'setDnsMode'. Did you mean: 'DnsMode'?
>
> This should probably work, right? It's this method:
> https://doc.qt.io/qt-6/qwebengineglobalsettings.html#setDnsMode
>
> The whole reason for doing this is that I want to remove the message that
> gets printed when using a QWebEngineView, which is this message:
> doh set to ""  --  SystemOnly
>
> Or is there a different way to make this message disappear?
>
> Thanks,
> Matic
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20240215/b045c17e/attachment.htm>


More information about the PyQt mailing list