I have a horizontal ScrollView with a ListView inside, and I want to scroll using the mouse wheel, but it seems not to work like it does in a vertical ScrollView.

Do I need to add some extra code in the horizontal ScrollView?

Thanks in advance,
Diego

My dummy code (with horizontal & vertical scrolls):

Qt Code:
  1. import QtQuick 2.0
  2. import QtQuick.Controls 1.3
  3.  
  4. Item {
  5.  
  6. height: 500
  7. width: 600
  8.  
  9. ScrollView {
  10. anchors { left: parent.left; leftMargin: 50; verticalCenter: parent.verticalCenter}
  11. height: 50
  12. width: 300
  13.  
  14. ListView {
  15.  
  16. height: 50
  17. width: contentWidth
  18.  
  19. orientation: Qt.Horizontal
  20. interactive: false
  21. clip: true
  22.  
  23. model: appModel
  24.  
  25. delegate: Rectangle {
  26. height: 50
  27. width: 50
  28. color: colorR
  29. // Text { anchors.centerIn: parent; text: colorR }
  30. }
  31. } // ListView
  32. }
  33.  
  34. ScrollView {
  35. anchors { right: parent.right; rightMargin: 50; verticalCenter: parent.verticalCenter}
  36. height: 300
  37. width: 50
  38.  
  39. ListView {
  40. height: contentHeight
  41. width: 50
  42.  
  43. interactive: false
  44. clip: true
  45.  
  46. model: appModel
  47.  
  48. delegate: Rectangle {
  49. height: 50
  50. width: 50
  51. color: colorR
  52. // Text { anchors.centerIn: parent; text: colorR }
  53. }
  54. } // ListView
  55. }
  56.  
  57. ListModel {
  58. id: appModel
  59.  
  60. ListElement { colorR: "red"}
  61. ListElement { colorR: "green"}
  62. ListElement { colorR: "blue"}
  63. ListElement { colorR: "cyan"}
  64. ListElement { colorR: "yellow"}
  65. ListElement { colorR: "blue"}
  66. ListElement { colorR: "lightgray"}
  67. ListElement { colorR: "red"}
  68. ListElement { colorR: "green"}
  69. ListElement { colorR: "blue"}
  70. ListElement { colorR: "cyan"}
  71. ListElement { colorR: "yellow"; }
  72. ListElement { colorR: "lightgray"}
  73. }
  74. }
To copy to clipboard, switch view to plain text mode