Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Custom window draging handler
Forum Updated to NodeBB v4.3 + New Features

Custom window draging handler

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 377 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Noturnoz
    wrote on last edited by Noturnoz
    #1

    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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved