<div dir="ltr">> On 22/10/2020 22:12, Ales Erjavec wrote:<br>> > A while ago I had a similar thought of subverting the property<br>> > descriptor protocol:<br><br>Well, that's very promising, thanks Ales.<br>At first look it seems to do exactly what I wanted!<br>Did you do some further testing to ensure its consistency and reliability?<br><br>> IMHO, that's not a property.<br>><br>> > But have not actually used it anywhere. Usually I just<br>> > use the convention of adding a underscore suffix to the<br>> > property member i.e.<br>> ><br>> > bar_  = pyqtProperty(int, fget=bar, fset=setBar)<br>><br>> Q_PROPERTY is a way of implementing in C++ something that is a property<br>> in QML and Qt Designer. It is not a property in C++.<br>><br>> Python properties are proper properties.<br><div><br></div><div>Unfortunately I'm not that good in low-level programming knowledge, but, while I see your point, I'd say that from a higher-level perspective (which is what the average python programmer uses) it's not that "big" a difference.</div><div>From my limited perspective and knowledge, I can only assume that an actual property is similar in behavior and performance to direct member variables in C++ (as with QStyleOption variables, for example) instead of using a callable to access a value.</div><div>Nonetheless, as stated in my first message, I'd like a more consistent way to access custom Qt properties just like the existing ones, and the solution provided by Ales seems the most promising so far, especially for properties that do not directly affect performance (such as painting, item view/delegate implementations or complex layout management).</div><div><br></div><div>Thank you,</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>