> On May 6, 2015, at 6:24 PM, Kevin Mcintyre <[email protected]> wrote:
> 
> That was pseudo code, I've been using qt5reactor to happy results.  All the 
> same good to know on deferreds working in non-twisted code...

pseudo-code can sometimes illustrate a point, but when working with a real, 
large, complex API like Qt, it's often useful to have a http://sscce.org 
<http://sscce.org/> available to make sure the point you are demonstrating is 
the same as the point you think you're demonstrating :).

> My challenge is having only 2 hooks into the DOM - javaScriptAlert and 
> javaScriptConfirm that ultimately with QtWebEngine aren't available.

When working with JS containers like this myself in the past, and needing to 
communicate with them from the container, I generally use eval as input:

http://doc.qt.io/qt-5/qwebenginepage.html#runJavaScript-2 
<http://doc.qt.io/qt-5/qwebenginepage.html#runJavaScript-2>

and then console messages as output:

http://doc.qt.io/qt-5/qwebenginepage.html#javaScriptConsoleMessage 
<http://doc.qt.io/qt-5/qwebenginepage.html#javaScriptConsoleMessage>

You should be able to speak to the JS running inside your container by emitting 
specially-formatted console messages, and firing Deferreds in response to those.

-glyph

_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to