image picker with clipboard and drag-n-drop capability for linux.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
714 B

2 years ago
  1. import QtQuick 2.15
  2. Item {
  3. id: container
  4. property alias path: image.source
  5. MouseArea {
  6. id: mouseArea
  7. width: container.width; height: container.height
  8. anchors.fill: container;
  9. drag.target: image;
  10. AnimatedImage {
  11. id: image
  12. anchors.fill: parent
  13. fillMode: Image.PreserveAspectFit
  14. Drag.active: mouseArea.drag.active
  15. Drag.hotSpot.x: 0
  16. Drag.hotSpot.y: 0
  17. Drag.mimeData: {
  18. "text/uri-list": container.path
  19. }
  20. Drag.dragType: Drag.Automatic
  21. Drag.onDragFinished: {
  22. Qt.quit()
  23. }
  24. onStatusChanged: {
  25. if (image.status === Image.Failed) {
  26. container.visible = false
  27. }
  28. }
  29. }
  30. }
  31. }