OptionSelector: Setting selectedIndex unpredictable
Bug #1589939 reported by
Dubstar_04
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-ui-toolkit (Ubuntu) |
Confirmed
|
High
|
Zsombor Egri |
Bug Description
setting the selectedIndex is unpredictable. it works on:
xenial desktop
M10 OTA 11
but fails on:
MX4 OTA 11
Krillin OTA 11
Krillin rc_proposed
Definitions:
Works - selectedIndex is set, optionSelection becomes animated and changes to set index.
Fails - selectedIndex is set, optionSelector remains at index 0 while the selectedIndex is changed to set index.
description: | updated |
To post a comment you must log in.
I had a look at the OptionSelector code this morning (for the first time) in the hope I could help Dan, one of our community developers, but one morning was not enough to be 100% sure of what's wrong here. I will leave a report of my investigation below:
Works -> on Krillin rc-proposed
Fails -> on Arale OTA11
Report: sCurrentItem logic was not triggered, otherwise scrolling from 0 to 6 would require info about delegates 4-5 as well.
- On Arale OTA11, where it fails, I see that when I select index > 3 not all delegates are created. Let's suppose I select the item with index 6, then close the app, open again, I see that ListView creates delegates 0,1,2,3 and 6, but not 4-5. That leads me to believe the highlightFollow
LOG: bazaar. launchpad. net/~ocs- team/owncloud- sync/trunk/ view/30/ Owncloud- Sync/Owncloud- Sync/ui/ AccountSettings Page.qml# L91
REFERENCE TO SOURCE OF THE APP EXPOSING THE BUG
http://
//this is onSourceChanged for the Image inside OptionSelectorD elegate /usr/lib/ arm-linux- gnueabihf/ qt5/qml/ Ubuntu/ Components/ Themes/ Ambiance/ artwork/ chevron_ down.png false false elegate having modelData "0", from inside Component. onCompleted /usr/lib/ arm-linux- gnueabihf/ qt5/qml/ Ubuntu/ Components/ Themes/ Ambiance/ artwork/ chevron_ down.png false false /usr/lib/ arm-linux- gnueabihf/ qt5/qml/ Ubuntu/ Components/ Themes/ Ambiance/ artwork/ chevron_ down.png false false /usr/lib/ arm-linux- gnueabihf/ qt5/qml/ Ubuntu/ Components/ Themes/ Ambiance/ artwork/ chevron_ down.png false false gsPage] - Set Frequency Index:6 /usr/lib/ arm-linux- gnueabihf/ qt5/qml/ Ubuntu/ Components/ Themes/ Ambiance/ artwork/ chevron_ down.png false false
qml: SOURCE 0 file://
//This is printed from the OptionSelectorD
qml: I AM ALIVE! 0
//onHeightChanged for the ListView inside OptionSelector.qml
qml: LISTVIEW HEIGHT 115
qml: SOURCE 15 file://
qml: I AM ALIVE! 15
qml: SOURCE 30 file://
qml: I AM ALIVE! 30
qml: SOURCE 45 file://
qml: I AM ALIVE! 45
qml: [AccountsSettin
qml: LISTVIEW CURRENTINDEX CHANGED TO 6
qml: SOURCE 120 file://
//Delegate with modelData 120 is instantiated, but not those with data "60", "120" (see app source link above). The listview does not scroll, and the UI still shows "No Sync", i.e. the element at index 0, even though ListView's currentIndex is now 6
qml: I AM ALIVE! 120
It seems like it could be a timing issue in ListView itself, i.e. highlightFollow sCurrentItem doesn't work if you set the currentIndex too early, although I'm not sure about this. Someone should have a deeper look.
- Additionally, OptionSelectorD elegate has a Connection to onCurrentlyExpa ndedChanged. bazaar. launchpad. net/~ubuntu- sdk-team/ ubuntu- ui-toolkit/ staging/ view/1986/ src/Ubuntu/ Components/ 1.3/OptionSelec torDelegate. qml#L166 ndedChanged slot is only called for the delegates at index 0,1,2,3, even though the view is now showing all delegates, from index...
http://
Let's pick up the case I described above again: I open the app, select "120 minutes" in the setting OptionSelector, then close the app, open it again (at this point the OptionSelector shows "No Sync" although currentIndex of the ListView is 6, as said in the previous bullet point). NOW I tap on the OptionSelector, it expands, and I notice that the onCurrentlyExpa