[SailfishDevel] Dynamically populate a ContextMenu: use of _underscore properties

zoltan.lutor at gmail.com zoltan.lutor at gmail.com
Sun Nov 24 09:43:49 UTC 2013


'protected' ? ;-)

I mean when a 'derived' component creted, altering/extending original vehaviour, they canbe used.

But just guessing...

Zoltán


christopher.lamb at thurweb.ch írta ekkor: 2013.11.24. 10:26

Andrey


I beg to differ.


You can hack in any language, just as you can apply clean coding 
conventions. QML is no different here, it is just a little less 
rigorous in enforcing some conventions.


Just like any code, QML code will need maintaining, updating etc, so I 
prefer to clean code and follow the conventions where they make sense.


http://harmattan-dev.nokia.com/docs/library/html/qt4/qml-coding-conventions.html clearly states that double underscore are private, not for external 
use.


So it's hands off double underscores, but this raises the moot point: 
what about single underscores like _contentColumn? By a strict reading 
of the conventions they are not private, so what does a single 
underscore imply?


Chris


Zitat von "Andrey Kozhevnikov" <coderusinbox at gmail.com>:


> Please check ContextMenu and ComboBox code.
> _contentColumn property used in a proper way.
>
> QML is not C++ where you not allowed to reimplement headers to use 
> private and protected functions outside. QML is hack-for-fun.
>
> On 24.11.2013 00:03, coderusinbox at gmail.com wrote:
>> We should not have to make that choice.
>>
>> using an underscore property is the pragmatic solution, but I would 
>> be interested to hear what the Jolla developers have to say on this 
>> issue.
>>
>> Zitat von "Andrey Kozhevnikov" <coderusinbox at gmail.com>:
>>
>>> You should use it if you want "real" dynamically created components.
>>> Or reimplement ContextMenu item.
>>>
>>> What would you prefer?
>>
>>
>>
>
>


_______________________________________________

SailfishOS.org Devel mailing list



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20131124/c135bb35/attachment.html>


More information about the Devel mailing list