<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">It is printed regardless of the dns mode.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="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="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="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="gmail_quote"><div dir="ltr" class="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="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="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="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>