[SailfishDevel] ContextMenu with repeater

Oleksii Serdiuk contacts at oleksii.name
Sun Jan 5 12:15:28 UTC 2014


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.

-- 
With best regards,
Oleksii Serdiuk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4813 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20140105/1c49a2e8/attachment.bin>


More information about the Devel mailing list