On Sun Apr 19 20:51:49 BST 2009, projetmbc wrote:
> Simon Edwards a écrit :
> > projetmbc wrote:
> >> I'm seeking for information about how to comunicate from PyQt with a
> >> JavaScript program.
> >
> > QWebFrame's evaluateJavaScript() might be a start.
> Indeed I'm looking for a simple example rather than an abstract one.

The porting of the C++ Qt examples to Python has fallen behind since Qt 4.3
so there aren't any simple WebKit examples included with PyQt. Still, the
recent Monster Evolution experiments on Qt Labs include a Python version
of a program that integrates with WebKit's JavaScript engine:


QWebFrame's addToJavaScriptWindowObject() method lets you insert an instance
of a QObject subclass into the page. You can expose methods to JavaScript,
but you have to declare them as slots with the @pyqtSignature() decorator.
The example code can be found here:



PyQt mailing list    PyQt@riverbankcomputing.com

Reply via email to