Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-25 Thread Tigre-Bleu
09:25:19 Objet: Re: [SailfishDevel] Dynamically populate a ContextMenu Hi, simply assign id to one of the static items, e.g. firstStatic, and then use firstStatic.parent instead of menu._contentColumn as parent for the dynamic items -- this way you do not rely on implementation details:

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-25 Thread Martin Kampas
Hi, simply assign id to one of the static items, e.g. firstStatic, and then use firstStatic.parent instead of menu._contentColumn as parent for the dynamic items -- this way you do not rely on implementation details: menu: ContextMenu { id: menu MenuItem { id: firstStatic; text: "Static

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

2013-11-24 Thread Andrey Kozhevnikov
can i use it if i copy both ComboBox and ContextMenu to my project? On 24.11.2013 19:22, christopher.l...@thurweb.ch wrote: Hi Andrey If the _underscore is, as we suspect an indication of "internal only", the next question is what is internal? Internal could mean to the component itself. Ho

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

2013-11-24 Thread christopher . lamb
Hi Andrey If the _underscore is, as we suspect an indication of "internal only", the next question is what is internal? Internal could mean to the component itself. However it could mean "internal to Silica". Under this definition a call from Combobox to ContextMenu could be regarded as in

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

2013-11-24 Thread Andrey Kozhevnikov
ComboBox can use private properties of ContextMenu, but i can't? really? :D On 24.11.2013 15:26, christopher.l...@thurweb.ch wrote: 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 rigorou

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

2013-11-24 Thread zoltan . lutor
'protected' ? ;-) I mean when a 'derived' component creted, altering/extending original vehaviour, they canbe used. But just guessing... Zoltán christopher.l...@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 codi

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

2013-11-24 Thread christopher . lamb
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

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-24 Thread Andrey Kozhevnikov
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, christopher.l...@thurweb.ch wrote: We should not have

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread William Su
3 10:14 To: christopher.l...@thurweb.ch Reply To: Sailfish OS Developers Cc: Sailfish OS Developers Subject: Re: [SailfishDevel] Dynamically populate a ContextMenu Just dont use dynamic childs if you dont want, but let it to others ;) On 24.11.2013 00:03, christopher.l...@thurweb.ch wrote: >

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread sonyfever
Sent from my BlackBerry 10 smartp

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread Marcin M.
Agree with Cristopher. This is a workaround, but it should be fixed so that no manual tweaking is needed. Just as in c++ - private is private. -- Marcin 2013/11/23 Andrey Kozhevnikov > Just dont use dynamic childs if you dont want, but let it to others ;) > > > On 24.11.2013 00:03, christopher.

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread Andrey Kozhevnikov
Just dont use dynamic childs if you dont want, but let it to others ;) On 24.11.2013 00:03, christopher.l...@thurweb.ch 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

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread christopher . lamb
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" : You should use it if you want "real" dynamically created components. Or rei

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread Tigre-Bleu
- De: "Andrey Kozhevnikov" À: "christopher lamb" , "Sailfish OS Developers" Envoyé: Samedi 23 Novembre 2013 16:08:30 Objet: Re: [SailfishDevel] Dynamically populate a ContextMenu You should use it if you want "real" dynamically created components. Or r

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread Andrey Kozhevnikov
You should use it if you want "real" dynamically created components. Or reimplement ContextMenu item. What would you prefer? On 23.11.2013 21:06, christopher.l...@thurweb.ch wrote: Hi Andrey Zitat von "Andrey Kozhevnikov" : you may need to make childs of menu._contentColumn, not just menu.

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread christopher . lamb
Hi Andrey Zitat von "Andrey Kozhevnikov" : you may need to make childs of menu._contentColumn, not just menu. I thought that the underscore stuff are private internal properties / functions that we mere mortals should not be using 8-) (Not that that would necessarily stop me). Chris

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread christopher . lamb
Hi Antoine One useful technique for finding out what the Silica components are doing (and how you may need to modify your code, or to prove a bug), is to create a private clone of the "problem" component in your project. In your case it is ContextMenu, which on my development host lives in

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread Andrey Kozhevnikov
you may need to make childs of menu._contentColumn, not just menu. On 23.11.2013 19:47, Tigre-Bleu wrote: Hi, I try to dynamically populate a ContextMenu but either I ran into a bug in the Silica Component or there is something I'm doing wrong. Here is an example of simplified code showing th

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread christopher . lamb
Hi Antoine I had a quick play around, and a peak back in my old code. Just changing the menu height does not change anything. I also tried a version of your code with just dynamic menuItems. The menu did not drop, it just flashes. The problem I was fighting with some months ago (and did my

Re: [SailfishDevel] Dynamically populate a ContextMenu

2013-11-23 Thread christopher . lamb
Hi Antoine I think I had similar problems some months ago. If I remember correctly, I had to explicitly resize the menu height after adding items to it. I will see if I can find the old code, and have a dig around in it ... Chris Zitat von Tigre-Bleu : Hi, I try to dynamically populate