[SailfishDevel] ContextMenu with repeater
Andrey Kozhevnikov
coderusinbox at gmail.com
Sun Jan 5 12:17:31 UTC 2014
I solved it. If context menu length > 6 it becomes dialog, and after
choosing dialog item fired only onItemChanged signal, not
onIndexChanged. With short combobox everything fine :)
You can mark it as found bug ;)
On 05.01.2014 18:15, Oleksii Serdiuk wrote:
> Did you try using `model.index` instead of just `index`?
>
> Are you sure that onClicked signal in MenuItem gets fired?
>
> On 03.01.2014 16:21, Andrey Kozhevnikov wrote:
>> Hello
>>
>> I can't get context menu index if using repeater inside
>>
>> ComboBox {
>> id: languageCombo
>> label: "Language"
>> currentIndex: 0
>> menu: ContextMenu {
>> id: languageMenu
>> Repeater {
>> width: parent.width
>> model: localeNames
>> delegate: MenuItem {
>> text: modelData
>> onClicked: {
>> console.log("selected: " + modelData)
>> console.log("selected: " + index)
>> }
>> }
>> }
>> onActiveChanged: {
>> console.log("index: " +
>> languageCombo.currentIndex)
>> }
>> }
>> onCurrentIndexChanged: {
>> if (languageMenu.active) {
>> console.log(index: " + currentIndex)
>> }
>> }
>> }
>>
>> No output is produced when i selecting item, but item in repeater
>> changed.
>
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20140105/38d2ca09/attachment.html>
More information about the Devel
mailing list