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

Alessandro Pasotti apasotti at gmail.com
Tue Oct 7 14:34:55 BST 2014


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?


-- 
Alessandro Pasotti
w3:   www.itopen.it


More information about the PyQt mailing list