Re: [PyKDE] crash: pure virtual function called

2002-11-12 Thread Hans-Peter Jansen
On Tuesday 12 November 2002 22:39, marvelan L wrote:
 I have built an application with Qt 3.0.4 and PyQt 3.4.

 From time to time I get a error message on stdout
 saying pure virtual function call and then abort is called
 and the program exits.

What about providing the facts at least, not some magical phrase.

Narrowing down the problem to the essence inside a test script 
often helps a lot. Remember: we're all telepathic unapt.

 I suspect that this is from the PyQt bindings. Have anyone
 seen this and know what to do about it?

 /Marv

Hans-Peter

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



RE: [PyKDE] crash: pure virtual function called

2002-11-12 Thread Jim Bublitz
On 12-Nov-02 marvelan L wrote:
 I have built an application with Qt 3.0.4 and PyQt 3.4.
 
From time to time I get a error message on stdout
 saying pure virtual function call and then abort is called
 and the program exits.
 
 I suspect that this is from the PyQt bindings. Have anyone
 seen this and know what to do about it?

Check the *Qt* docs and see if either:

1. One of the classes you're using is abstract
2. A method in a class you're using ends in  = 0, for example:

virtual int someMethod (QWidget *parent) = 0;

(2) is an example of a pure virtual function. When a method like
(2) exists in a class, the class is abstract. When the class is
abstract, you can't instantiate it. You have to subclass the
abstract class and overload *all* of the pure virtual functions,
so for example:

C++ (Qt):

class SomeAbstractClass
{
public:
...
virtual int someMethod (QWidget *parent) = 0;
...
};
 
Python (your program):
-
class SomeClass (SomeAbstractClass):
...
def someMethod (self, parent):
do something here because the
pure virtual method probably 
doesn't do anything
...

and def EVERY pure virtual function in the abstract class (usually
there are only a few at most, possibly only one).

If neither 1 or 2 is true, then you'll need to provide more
information about what your program is doing.


Jim

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] crash: pure virtual function called

2002-11-12 Thread Phil Thompson
On Tuesday 12 November 2002 9:39 pm, marvelan L wrote:
 I have built an application with Qt 3.0.4 and PyQt 3.4.

 From time to time I get a error message on stdout
 saying pure virtual function call and then abort is called
 and the program exits.

 I suspect that this is from the PyQt bindings. Have anyone
 seen this and know what to do about it?

A quick grep of the SIP and PyQt sources shows that the message isn't coming 
from the bindings directly.

Phil

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde