MainPage.qml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import QtQuick 1.1
  2. import com.nokia.symbian 1.1
  3. import QtMobility.gallery 1.1
  4. import ExifItemSymbian 1.0
  5. Page {
  6. id: mainPage
  7. ExifItem{
  8. id: exifItem
  9. }
  10. Component{
  11. id: thumbnailDelegate
  12. Rectangle {
  13. id: thumbnailDelegateRectangle
  14. width: galleryView.cellWidth
  15. height: galleryView.cellHeight
  16. color: "transparent"
  17. radius: 5
  18. Image {
  19. id: itemImage
  20. source: url
  21. sourceSize.height: galleryView.cellHeight
  22. sourceSize.width: galleryView.cellWidth
  23. anchors.fill: parent
  24. anchors.margins: 5
  25. anchors.verticalCenter: parent.verticalCenter
  26. anchors.horizontalCenter: parent.horizontalCenter
  27. asynchronous: true
  28. }
  29. MouseArea{
  30. anchors.fill: parent
  31. onClicked: {
  32. exifItem.getGpsPointer(itemImage.source)
  33. }
  34. }
  35. GridView.onAdd: NumberAnimation { target: thumbnailDelegateRectangle; property: "scale"; from: 0.0; to: 1.0; easing.type: Easing.OutQuad }
  36. }
  37. }
  38. GridView{
  39. id: galleryView
  40. anchors.fill: parent
  41. delegate: thumbnailDelegate
  42. focus: true
  43. model: DocumentGalleryModel{
  44. rootType: DocumentGallery.Image
  45. autoUpdate: true
  46. properties: ["url","created","dateTaken","lastModified"]
  47. sortProperties: ["created","dateTaken","lastModified"]
  48. }
  49. cellWidth: (width/3)-0.5
  50. cellHeight: cellWidth
  51. }
  52. }