[PyQt] Overriding only one of two C++ virtual methods with different signature

Adeodato Simó dato at net.com.org.es
Sun Jan 20 09:40:23 GMT 2008


* Phil Thompson [Sat, 19 Jan 2008 19:21:10 +0000]:

> You need to handle both cases. Check the type of the argument to determine 
> which one is called. For the one you aren't interested in, just call the base 
> implementation...

>     def updateSearch(self, arg):
>         if not isinstance(arg, QString):
>             superclass.updateSearch(self, arg):
>         else:
>             do_your_thing()

OK, this is exactly what I was doing, but wanted to know if there was
another way.

Thank you,

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
                     Listening to: Joaquín Sabina - Con lo que eso duele



More information about the PyQt mailing list