<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Excellent, thank you Charles 👍</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Charles <peacech@gmail.com><br>
<b>Sent:</b> Thursday, February 15, 2024 4:52 PM<br>
<b>To:</b> Matic Kukovec <kukovecmatic@hotmail.com><br>
<b>Cc:</b> PyQt@riverbankcomputing.com <pyqt@riverbankcomputing.com><br>
<b>Subject:</b> Re: "PyQt6.QtWebEngineCore.QWebEngineGlobalSettings.setDnsMode" missing method?</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif; font-size:small">
It is printed regardless of the dns mode.</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif; font-size:small">
<br>
</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif; font-size:small">
To hide the message you can set env `set QT_LOGGING_RULES="*.debug=false"` or call setFilterRules as written in
<a href="https://doc.qt.io/qt-6/qloggingcategory.html">https://doc.qt.io/qt-6/qloggingcategory.html</a>.</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif; font-size:small">
<br>
</div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif; font-size:small">
I have checked that setting QT_LOGGING_RULES did remove the doh message in my qwebengine app.<br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Thu, Feb 15, 2024 at 10:36 PM Matic Kukovec <<a href="mailto:kukovecmatic@hotmail.com">kukovecmatic@hotmail.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_msg549151014029981350">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Specs:</div>
<ul style="margin-top:0px; margin-bottom:0px; list-style-type:disc">
<li style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Windows 10 x64</div>
</li><li style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Python 3.12 x64</span></li><li style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">PyQt 6.6.1</span></li><li style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">QWebEngine 6.6.0</span></div>
</li></ul>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Running this code:</div>
<div style="margin-left:40px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">import PyQt6.QtWebEngineCore</span></div>
<div style="margin-left:40px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">dns_mode = PyQt6.QtWebEngineCore.QWebEngineGlobalSettings.DnsMode()</span></div>
<div style="margin-left:40px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">dns_mode.secureMode = PyQt6.QtWebEngineCore.QWebEngineGlobalSettings.SecureDnsMode.SystemOnly</span></div>
<div style="margin-left:40px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">PyQt6.QtWebEngineCore.QWebEngineGlobalSettings.setDnsMode(dns_mode)</span></div>
<div style="margin-left:0px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="margin-left:0px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">... throws this error:</span></div>
<div style="margin-left:0px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">AttributeError: type object 'QWebEngineGlobalSettings' has no attribute 'setDnsMode'. Did you mean: 'DnsMode'?</span></div>
<div style="margin-left:0px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="margin-left:0px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">This should probably work, right? It's this method:
<a href="https://doc.qt.io/qt-6/qwebengineglobalsettings.html#setDnsMode" id="x_m_549151014029981350LPlnk935003" target="_blank">
https://doc.qt.io/qt-6/qwebengineglobalsettings.html#setDnsMode</a></span></div>
<div style="margin-left:0px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="margin-left:0px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">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:</span></div>
<div style="margin-left:40px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">doh set to ""  --  SystemOnly</span></div>
<div style="margin-left:0px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="margin-left:0px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Or is there a different way to make this message disappear?</span></div>
<div style="margin-left:0px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="margin-left:0px"><span style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Thanks,
<div>Matic</div>
<br>
</span></div>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>