Make dialogs draggable

This commit is contained in:
Jaquee
2017-05-03 11:08:59 +02:00
parent 4ca35af11a
commit 8cd6f3f5b6
4 changed files with 35 additions and 0 deletions

View File

@@ -59,6 +59,15 @@ Window {
width: 480
height: 280
// Make window draggable
MouseArea {
anchors.fill: parent
property point lastMousePos: Qt.point(0, 0)
onPressed: { lastMousePos = Qt.point(mouseX, mouseY); }
onMouseXChanged: root.x += (mouseX - lastMousePos.x)
onMouseYChanged: root.y += (mouseY - lastMousePos.y)
}
ColumnLayout {
id: mainLayout
spacing: 10