Advertisement
artemmarchenko

Untitled

Aug 19th, 2011
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. import QtQuick 1.0
  2.  
  3. Rectangle {
  4. width: 450
  5. height: 300
  6.  
  7. Component {
  8. id: highlight
  9. Rectangle {
  10. width: 180; height: 40
  11. color: "lightsteelblue"; radius: 5
  12. y: list.currentItem.y
  13. Behavior on y {
  14. SpringAnimation {
  15. spring: 3
  16. damping: 0.2
  17. }
  18. }
  19. }
  20. }
  21.  
  22. ListView {
  23. id: list
  24. width: parent.width; height: 200
  25. model: 6
  26. orientation: ListView.Horizontal
  27. delegate: Rectangle {
  28. border.width: 1
  29. width: 150
  30. // height: 40
  31. Text { text: model.index }
  32.  
  33. Keys.onDownPressed: {
  34. list.currentIndex += 1
  35. list.positionViewAtIndex(3, ListView.Beginning)
  36. }
  37. }
  38.  
  39. highlight: highlight
  40. highlightFollowsCurrentItem: true
  41. focus: true
  42. }
  43.  
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement