[PyQt] problem with abstract classes

Diez B. Roggisch deets at web.de
Tue Aug 14 08:47:05 BST 2007


Giovanni Bajo schrieb:
> On 12/08/2007 16.20, Diez B. Roggisch wrote:
> 
>> Any suggestions? Am I doing something fundamentally wrong wrt 
>> implementation of C++-interfaces?
> 
> Please post a minimal, complete example that reproduces your problem. 
> Otherwise, it's a little hard to help you...

I know... So I tried to come up with a smaller example. However, it's 
not showing the same, but another problem. Until that is fixed, I think 
investigating the old problem is pretty much useless.

The attached project tries to model the situation I have in my real app. 
It compiles & runs under my Mac.

Essentially all I try to do is to create a interface in C++ 
(IEventReceiver), a subclass (PyIEventReceiver) to overload the pure 
virtual methods of the base-interface so it can be overloaded in python 
and a test-class that invokes the OnEvent-method in a previously set 
IEventReceiver implementation.

Then in the python-test-script, I try and instantiate the test-object, 
and subclass the PyIEventReceiver. The latter is the problem. When 
passing that into the test-object and invoke the test-method, I don't 
get the overloaded method invoked.

How do I achieve that?

I'm not sure if the two problems are related - but until this works, 
it's moot to try and make the other problem go away.

Kind regards,

Diez
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SIPTest.tgz
Type: application/x-gzip
Size: 972 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070814/67a2ce30/SIPTest.tgz


More information about the PyQt mailing list