|
|
- import QtQuick 2.15
-
- Item {
- id: container
- property alias path: image.source
-
- MouseArea {
- id: mouseArea
- width: container.width; height: container.height
- anchors.fill: container;
- drag.target: image;
-
- AnimatedImage {
- id: image
- anchors.fill: parent
-
- fillMode: Image.PreserveAspectFit
-
- Drag.active: mouseArea.drag.active
- Drag.hotSpot.x: 0
- Drag.hotSpot.y: 0
- Drag.mimeData: {
- "text/uri-list": container.path
- }
-
- Drag.dragType: Drag.Automatic
-
- Drag.onDragFinished: (x) => {
- if (x === 1)
- Qt.quit()
- }
-
- onStatusChanged: {
- if (image.status === Image.Failed) {
- container.visible = false
- }
- }
- }
- }
- }
|