How and why Qt functions can be overridden

Maurizio Berti maurizio.berti at gmail.com
Sun Aug 29 19:09:48 BST 2021


Thank you for your reply, but it doesn't really answer my question.


> One thing is that I don't think being public or protected or private is
>> important for overridden methods. They will behave the same way regardless
>> as far as virtualness and being overridden are concerned. The only thing
>> that changes is who can invoke them.
>>
>
That's exactly my point: I know I can override a protected non virtual
method, but that would only be "just another method" that will only be
called when explicitly called by me: I could even name it in any other
way, and that won't change anything.
The problem is about methods that are invoked by Qt itself, like those I
reported: QItemDelegate.drawBackground or QComboBox.initStyleOption. If
they are implemented, they are never used by Qt, and can only be explicitly
called by python code.

Thank you anyway,
Maurizio
-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210829/85b115c2/attachment.htm>


More information about the PyQt mailing list