<div dir="ltr">Hi Florian, <div>thank you for the right way!<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-22 12:05 GMT+02:00 Florian Bruhin <span dir="ltr"><<a href="mailto:me@the-compiler.org" target="_blank">me@the-compiler.org</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">* Peter Irbizon <<a href="mailto:peterirbizon@gmail.com">peterirbizon@gmail.com</a>> [2014-05-22 11:31:11 +0200]:<br>

<div class="">> Hi<br>
> I have this browser code and I am trying to put accept-language header. I<br>
> have no idea how to do it in this code. Can you help me what/where to add<br>
> it? Many thanks<br>
><br>
</div>> [...]<br>
<br>
You need to subclass QNetworkAccessManager to add the header,<br>
something like this:<br>
<br>
    class NetworkManager(QNetworkAccessManager):<br>
        def createRequest(self, op, req, outgoing_data):<br>
            req.setRawHeader('Accept-Language'.encode('ascii'),<br>
                             'en-US,en'.encode('ascii'))<br>
            return super().createRequest(op, req, outgoing_data)<br>
<br>
And then use setNetworkAccessManager() on your QWebPage.<br>
<span class="HOEnZb"><font color="#888888"><br>
Florian<br>
<br>
--<br>
() ascii ribbon campaign - stop html mail    <a href="http://www.asciiribbon.org" target="_blank">www.asciiribbon.org</a><br>
/\ <a href="http://www.the-compiler.org" target="_blank">www.the-compiler.org</a>  | I love long mails <a href="http://email.is-not-s.ms/" target="_blank">http://email.is-not-s.ms/</a><br>
No one can guarantee the actions of another. -- Spock, "Day of the Dove",<br>
stardate unknown<br>
</font></span><br>_______________________________________________<br>
PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></blockquote></div><br></div>