[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: "PyQt6.QtWebEngineCore.QWebEngineGlobalSettings.setDnsMode" missing method?
From:       Matic Kukovec <kukovecmatic () hotmail ! com>
Date:       2024-02-15 15:59:47
Message-ID: PAVPR10MB68371D059B1C6A5E2CB689DED74D2 () PAVPR10MB6837 ! EURPRD10 ! PROD ! OUTLOOK ! COM
[Download RAW message or body]

[Attachment #2 (text/plain)]

Excellent, thank you Charles 👍
________________________________
From: Charles <peacech@gmail.com>
Sent: Thursday, February 15, 2024 4:52 PM
To: Matic Kukovec <kukovecmatic@hotmail.com>
Cc: PyQt@riverbankcomputing.com <pyqt@riverbankcomputing.com>
Subject: Re: "PyQt6.QtWebEngineCore.QWebEngineGlobalSettings.setDnsMode" missing \
method?

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@hotmail.com<mailto:kukovecmatic@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


[Attachment #3 (text/html)]

<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 \
&lt;peacech@gmail.com&gt;<br> <b>Sent:</b> Thursday, February 15, 2024 4:52 PM<br>
<b>To:</b> Matic Kukovec &lt;kukovecmatic@hotmail.com&gt;<br>
<b>Cc:</b> PyQt@riverbankcomputing.com &lt;pyqt@riverbankcomputing.com&gt;<br>
<b>Subject:</b> Re: &quot;PyQt6.QtWebEngineCore.QWebEngineGlobalSettings.setDnsMode&quot; \
missing method?</font> <div>&nbsp;</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=&quot;*.debug=false&quot;` 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 \
&lt;<a href="mailto:kukovecmatic@hotmail.com">kukovecmatic@hotmail.com</a>&gt; \
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&nbsp;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&nbsp;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 &quot;&quot; &nbsp;-- &nbsp;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>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic