[PyQt] QWebPage plug-ins

Phil Thompson phil at riverbankcomputing.com
Sun Jun 14 13:26:38 BST 2009

On Sun, 14 Jun 2009 12:05:26 +0200, Alejandro Serrano <trupill at gmail.com>
> Hi,
> I'm trying to use QWebView to show some information to the user. However,
> need to include a custom plug-in for the task. Following some tutorials,
> saw 
> that I has to implement some functions in QWebPage, and more important,
> register my plug-in types in the MetaType system (or something like
> that...)
> With PyQt 4.4, I was using some sort of hack: I created a QVariant of
> instance of the type I wanted to register and everything worked (I read
> on 
> some post in this list). But I updated to PyQt 4.5 and everything stopped

> working, now it seems that just using QVariant(<instance>) does not
> register 
> the type. What's the correct way to do it now?
> If it was possible, I would like not to use C++ code, because the app
> should 
> be easily portable.

It's true that earlier versions of PyQt registered a lot of C++ types that
Qt didn't register automatically, but that was an implementation detail and
not documented behavior. As the registration is template based it has to be
done from C++.


More information about the PyQt mailing list