[PyQt] Calling subclass-overridden methods from C++

Phil Thompson phil at riverbankcomputing.com
Tue Oct 7 15:11:22 BST 2014


On 07/10/2014 2:34 pm, Alessandro Pasotti wrote:
> 2014-10-07 15:31 GMT+02:00 Alessandro Pasotti <apasotti at gmail.com>:
>> Hi,
>> 
>> I'm currently busy trying to add python plugins support to the server
>> side of QGIS (http://www.qgis.org).
>> 
>> Basically, I've written all the c++ part, and python plugins are
>> successfully loaded and started, what I still don't understand is how
>> to call from C++ code the Python overridden methods.
>> 
>> In C++ I have a class QgsServerFilter with a default empty method for
>> requestReady()
>> 
> 
> Sorry: silly TAB in Gmail.
> 
> In the Python plugin I do something like:
> 
> class HelloServer(QgsServerFilter):
>     def requestReady()
>         pass
> 
> 
> then I pass the HelloServer instance to C++ (stored into "filter") and
> later on C++ calls:
> 
> filter->requestReady()
> 
> but instead of calling HelloServer->requestReady() the base (empty)
> method is called.
> 
> What am I doing wrong?

Impossible to say with the information you have provided.

Phil


More information about the PyQt mailing list