Hi,

I'm trying to change the source of the repeater elements with condition included however the condition wasn't included after the changes

Qt Code:
  1. Row {
  2. id: level
  3. Repeater {
  4. id:levelRepeater
  5. model: 15
  6.  
  7. Image {
  8. id: levelImg
  9. source: levelArea.containsMouse ? "../images/mdpi/level-off-over-vertical.png" : "../images/mdpi/level-off-vertical.png"
  10. fillMode: Image.PreserveAspectFit
  11.  
  12. MouseArea {
  13. id: levelArea
  14. anchors.fill: parent
  15. hoverEnabled: true
  16. onClicked: {
  17. if (volume === -1 || index > volume) {
  18. volume = index
  19. for(var i = 0; i <= index; ++i) {
  20. level.children[i].source = levelArea.containsMouse ? "../images/mdpi/level-on-over-vertical.png" : "../images/mdpi/level-on-vertical.png"
  21. }
  22. } else if (index < volume) {
  23. for(var y = volume; y > index; --y) {
  24. level.children[y].source = levelArea.containsMouse ? "../images/mdpi/level-off-over-vertical.png" : "../images/mdpi/level-off-vertical.png"
  25. }
  26. volume = index
  27. }
  28. }
  29. }
  30. }
  31. }
  32. }
To copy to clipboard, switch view to plain text mode 

I also tried using states and PropertyChanges, however i am having problem assigning the target of the repeater items, any idea how?

I can't find any related issue in the forum and on the net.
Any help is greatly appreciated.