Main.qml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (c) 2010 Nokia Corporation.
  3. */
  4. import Qt 4.7
  5. Rectangle {
  6. id: myRectangle
  7. signal showImage(variant p)
  8. width: 100
  9. height: 100
  10. anchors.fill: parent
  11. color: "black"
  12. GridView {
  13. id: gridView
  14. property int pictureSize: parent.width/2.5
  15. // 4,4: no focus animation
  16. // 12,4: focus is shown a second
  17. // 12, 12: foucs is visible all the time
  18. property int focusOnWidth: 4
  19. property int focusOffWidth: 4
  20. property bool removeFocus: false
  21. objectName: "gridView"
  22. cellWidth: pictureSize; cellHeight: pictureSize
  23. focus: true
  24. keyNavigationWraps: true
  25. anchors.fill: parent
  26. anchors.margins: (parent.width - pictureSize*2) / 2
  27. model: pictureModel
  28. delegate: ListItem {
  29. id: listItem
  30. imageHeight: gridView.pictureSize
  31. selectedRow: listItem.GridView.isCurrentItem ? true : false
  32. onRowSelected: {
  33. gridView.currentIndex = model.index
  34. showImage(listItem.fullpath)
  35. //console.log(listItem.fullpath)
  36. }
  37. }
  38. transform: Rotation {
  39. origin.x: width/2
  40. origin.y: height/2
  41. axis { x: 0; y: 0; z: 1 }
  42. angle: 10
  43. }
  44. }
  45. }