Re: [Interest] Setting currentIndex in Qt Quick ComboBox does not work

2016-03-23 Thread Fabian Sturm
Hi, here a short update, I think I finally cracked my problem! Somehow setting currentIndex initially seems to break the model loading. But if I leave that out and connect to onModelChanged it works. Final problem was that the model loading was overriding my selected item. I solved that by no long

Re: [Interest] Setting currentIndex in Qt Quick ComboBox does not work

2016-03-23 Thread Fabian Sturm
Hi Jerome! Thanks a lot for your help and I already read the article and tried for another several hours. Unfortunately I still can only get one half working. Here is the new code for the event propagation: ComboBox { id: combo width: parent.width model: mymodel.items // order is impo

Re: [Interest] Setting currentIndex in Qt Quick ComboBox does not work

2016-03-23 Thread Jérôme Godbout
Hi, You have a binding problem here inside the combobox: *currentIndex: getCurrentIndex(mymodel.items, mymodel.item)* this binding will get override when the user change the current value of the combobox, the combo box will assign an int to this value. You need to set the model onCurrentIndexChange

[Interest] Setting currentIndex in Qt Quick ComboBox does not work

2016-03-22 Thread Fabian Sturm
Hello list, I hope this is the right forum to write, even though my sample code is in Python but I think the problem lies deeper in the event propagation or similar. What I want to do looks simple at first. I want to show a ComboBox with a list of items in it and one of them is selected. On a pus