[PyQt] Bug in QWebKit?...

Andreas Pakulat apaku at gmx.de
Fri Jan 13 07:16:42 GMT 2012


On 12.01.12 16:28:17, James Polk wrote:
> 
> 
> Greetings All,
> 
> We've uncovered what appears to be a very unfortunate bug in QWebKit...
> If it is indeed a bug, we can't tell _where_ the bug is originating from..
> ..is it a Qt-bug? PyQt? We're on Qt 4.7,..could it be fixed in 4.8? (Env info below)
> 
>
> Essentially what's happening,..is that there is a difference between the data
> that is returned via JavaScript method vs. DOM method.  We're trying to decide
> which one to use, this issue isn't helping, lol...
> 
> When you run the program,...a textField and two buttons are displayed.
>     1. In the textField is "John".
>     2. Hitting Button1 calls a decorator pyqtslot/function that changes the textField to "Mary".
>     3. Hitting Button2 calls a different decorator pyqtslot/function that queries the textField in two ways,
>         one JavaScript, one via DOM.
> 
>     4. JavaScript returns "Mary"
>                 DOM returns "John"
> 
> which one's correct?....

This is interesting, in particular if you add a line like:

print "evalJS value:", frame.evaluateJavaScript("document.getElementById('nameId').value;").toString()

You can see that there the value is also Mary. I first thought it was
just a matter of the slot being invoked lazily, but this proves
thats not the case. I'm rather sure this is a Qt bug, since I don't
think PyQt does fancy things when wrapping the QFrame-API. Also note,
the manual DOM navigation via the documentElement()+firstChild() etc.
also gives the wrong value.

BTW: I'm on Linux here, otherwise same versions of Qt, sip, PyQt.

Andreas



More information about the PyQt mailing list