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.
|
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: {
|
|
Qt.quit()
|
|
}
|
|
|
|
onStatusChanged: {
|
|
if (image.status === Image.Failed) {
|
|
container.visible = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|