[PyQt] Monkeypatching QWebPage.userAgentForUrl
kayhayen at gmx.de
Fri May 13 02:23:30 BST 2011
>> Somehow it seems, that the my patched method is never called.
>> What could be the reason?
>> thanks in advance for any explanations or suggestions how to change the
>> user agent 'globally'
> Why do you try to monkeypatch it? Subclassing QWebView and implementing just
> the overridden method is much cleaner and doesn't look like a hack.
Also if you my message about the SIP issue, it appears that the PyQt
core will not consider any overload it doesn't detect as being such at
class creation time.
I almost clearly doubt, that attribute assignment will modify the class
In general, it appears, that to overload you must use a class and for me
unfortunately, it must be a pure Python function or method object at
Enhancing sip to be able to track at run time the changes to the class
appears possible. For consistency with Python it should be done, but the
benefit, other than consistency with every other Python class, I admit,
More information about the PyQt