[Kde-bindings] Qyoto: read-only properties, with Brian Crowell's help

Dimitar Dobrev dpldobrev at yahoo.com
Sun Dec 16 22:20:27 UTC 2012


    
    Hi all,

    Qyoto now uses read-only properties instead of methods where methods have no parameters and are only assumed to return a value. It is Brian Crowell's idea and initial work. Binaries are not uploaded yet.

    Brian, I've used parts of your code but there are 2 major changes you should know about:
    1. I've decided to change the approach from enumerating properties to enumerating verbs, as I mentioned earlier - the reasoning is that now there's no need to manually scan the huge Qt API for property-like methods; also, it turned out pretty easy to do. There are categorised dictionaries only so I only had to get one, leave only the single-worded verbs that are not also nouns using a few regular expressions, and the result was a text file of only 108 K/11 500 lines which doesn't slow the build significantly. I'd like to hear in more detail your opinion so that the disadvantages this approach may have are noted and fixed;
    2. I haven't committed the "Get" prefix on methods yet. I've found an unpleasant bug with property generation which I'd like to fix beforehand. It is old, it's just that I noticed it while merging and changing your code. The problem is that in some cases methods shadow properties. The case I've found is that QObject has a Parent property, and the QAbstractItemModel, which inherits from QObject, generates a Parent() method which shadows the property. Once I fix this I'll work on integrating your "Get" part as well.
    

    Regards,
    Dimitar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20121216/b3858346/attachment.html>


More information about the Kde-bindings mailing list