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. How to implement custom resize handlers for ApplicationWindow, correctly?
Forum Updated to NodeBB v4.3 + New Features

How to implement custom resize handlers for ApplicationWindow, correctly?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 346 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.
  • A Offline
    A Offline
    adutzu89
    wrote on last edited by
    #1

    Hi all,

    I have an application with Qt.FramelessWindowHint flag and I want to reimplement resize for it but I'm a bit stuck because the resizing has a haotic animation.

    ResizeController.qml:

    Item {
        id: root
        property int cursorShape: Qt.SizeHorCursor
        property int xResize: 0
        property int yResize: 0
    
        MouseArea {
            id: mouseArea
            anchors.fill: parent
            acceptedButtons: Qt.LeftButton
            cursorShape: root.cursorShape
            onPositionChanged: {
                xResize = mouse.x
                yResize = mouse.y
            }
        }
    }
    

    Usage:

    ResizeController {
            anchors.bottom: parent.bottom
            anchors.right: parent.right
            width: 20
            height: width
            cursorShape: Qt.SizeFDiagCursor
            onXResizeChanged: window.width = window.width + xResize
            onYResizeChanged: window.height = window.height + yResize
        }
    

    Any ideeas what I am doing wrong?
    I'm using for building / testing: KDE Neon developer stable, 64 bit version.

    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