Thumbnail.qml 525 B

12345678910111213141516171819202122232425262728
  1. import QtQuick 1.0
  2. Rectangle {
  3. id: thumbnail
  4. property string source
  5. signal clicked()
  6. radius: width == 0 ? 0 : 5
  7. border.color: "#808080"
  8. border.width: width == 0 ? 0 : 3
  9. color: mouseArea.pressed ? "black" : "white"
  10. Image {
  11. source: thumbnail.source
  12. anchors.centerIn: parent
  13. MouseArea {
  14. id: mouseArea
  15. anchors.fill: parent
  16. onClicked: {
  17. thumbnail.clicked()
  18. }
  19. }
  20. }
  21. }