I’m looking for a way of dragging frameless window in QtQuick2. I followed this thread on the forum Link but it gives me an error.
Main difference in the code is tha
A rather complete example:
import QtQuick 2.14
import QtQuick.Controls 2.14
ApplicationWindow {
visible: true
width: 200
height: 200
flags: Qt.FramelessWindowHint
MouseArea {
anchors.fill: parent
onPressed: { pos = Qt.point(mouse.x, mouse.y) }
onPositionChanged: {
var diff = Qt.point(mouse.x - pos.x, mouse.y - pos.y)
ApplicationWindow.window.x += diff.x
ApplicationWindow.window.y += diff.y
}
property point pos
}
}