<div dir="ltr"><div class="gmail_quote" style="margin-left:40px"><div>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.<br></div></div><div style="margin-left:40px">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.</div><div><br></div><div>Yes, I agree.</div><div><br></div><div>I don't know Qt in that much detail, but I would hope that, if a method was not made virtual, it's because the designers thought there would be some other way of overriding behavior. But it could be that they were simply not thinking big enough.<br><br></div><div>As for making a non-virtual method virtual, you're right, I don't think that's possible at all.</div><div><br></div><div>Good luck,</div><div><br></div><div>Rodrigo<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Aug 29, 2021 at 11:12 AM Maurizio Berti <<a href="mailto:maurizio.berti@gmail.com">maurizio.berti@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div><div class="gmail_quote"><div>Thank you for your reply, but it doesn't really answer my question.</div><div> <br></div></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>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.</div></div></blockquote></div></blockquote><div><br></div><div>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.<br></div></div><div>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.</div><div><br></div><div>Thank you anyway,</div><div>Maurizio</div>-- <br><div dir="ltr">È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br><a href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a></div></div></div>
</blockquote></div>