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

Matic Kukovec kukovecmatic at hotmail.com
Thu Feb 15 15:18:37 GMT 2024


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/81646546/attachment.htm>


More information about the PyQt mailing list