[PyQt] Is it possible to override/extend QTextCursor?

Aaron Digulla digulla at hepe.com
Sun Jan 6 19:11:16 GMT 2008


Phil Thompson schrieb:

>> I'm using openSUSE Linux and python-qt4 4.3-19. The methods are defined
>> in qtextcursor.sip, only insertText() is confusing:
>>
>>     void insertText(const QString &text);
>>     void insertText(const QString &text, const QTextCharFormat &format);
>>
>> Which one will Python overload?
>>
>> Any ideas what could be wrong?
> 
> You can't overload non-virtual functions.

:-/ So what are my options when I have to intercept insertText? Is it
possible at all with PyQt4?

If not, I'd have to hack myself into the event functions (they are
virtual) but that means I'd have to reimplement most of Qt4's event
handling code and I'm not looking forward to that ...

Regards,

-- 
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
http://www.pdark.de/


More information about the PyQt mailing list