Nominate our 2022 Qt Champions!

Custom window draging handler

  • Hello, I have made following window dragging handler, but the problem is that the moving is not smooth. The window is "shaking" when I move it.

    MouseArea {
        anchors.fill: parent
        property variant clickPos: "1,1"
        onPressed: {
            clickPos  = Qt.point(mouse.x,mouse.y)
        onPositionChanged: {
            var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y)
            rootApplicationWindow.x += delta.x;
            rootApplicationWindow.y += delta.y;
        propagateComposedEvents: true

    I am using this custom handler, because I am using FramelessWindow, so I can make whole UI custom, without native toolbars etc.

    Can someone tell me, if it is possible to create custom handler, which won't shake the window when draggin?

Log in to reply