hai

My goal is to create a dropdown list in qml. There are some drop downs which are aligned vertically(like

News
Sports
Entertainment
)
when we click the arrow button on the right side of each of these, TV channel lists corresponding to each category will enlist.can i do it using list element and ListView

i coded like this
Qt Code:
  1. main.qml
  2. import QtQuick 1.1
  3.  
  4.  
  5. Rectangle {
  6. width: 400;height: 300
  7. Component {
  8. id: highlight
  9. Rectangle {
  10. id:backImage
  11. width: 400; height: 30
  12. color: "#b5b8b7"; radius: 25
  13. Rectangle {
  14. anchors.centerIn:backImage
  15. width: 375; height: 25
  16. color: "#cfd5d4"; radius: 20
  17. y: list.currentItem.y
  18. Behavior on y {
  19. SpringAnimation {
  20. spring: 3
  21. damping: 0.2
  22. }
  23. }
  24. }
  25. }
  26. }
  27.  
  28. ListView {
  29. id: list
  30. width: 180; height: 200
  31.  
  32. model: List{}
  33. delegate: Text { text: name }
  34.  
  35. highlight: highlight
  36. highlightFollowsCurrentItem: false
  37. focus: true
  38.  
  39. }
  40. }
  41.  
  42. List.qml
  43.  
  44.  
  45. import QtQuick 1.1
  46.  
  47.  
  48. ListModel {
  49. id: feeds
  50. ListElement { name: "news";}
  51. }
To copy to clipboard, switch view to plain text mode