-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.qml
36 lines (33 loc) · 818 Bytes
/
test.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import QtQuick
Window {
id:root
width: 640
height: 480
visible: true
color: "#00000000"
title: qsTr("simple window")
property int dragX: 0
property int dragY: 0
property bool dragging: false
flags: Qt.FramelessWindowHint
Rectangle {
color: "lightblue"
anchors.fill: parent
radius: 10
MouseArea {
anchors.fill: parent
onPressed:{
root.dragX = mouseX
root.dragY = mouseY
root.dragging = true
}
onReleased: root.dragging = false
onPositionChanged:{
if(root.dragging){
root.x += mouseX - root.dragX
root.y += mouseY - root.dragY
}
}
}
}
}