How to create a resizable frameless window?
-
I'm trying to create a resizable frameless window. In
onPositionChangedof aMouseAreathat fills entireWindow, here is part of my codeif (resizable && cursorShape !== Qt.ArrowCursor) { // resize var leftTop = Qt.point(control.x, control.y) var rightBottom = Qt.point(control.x + width, control.y + height) var globalMouse = mapToGlobal(Qt.point(mouseX, mouseY)) if (edgeFlag & ShadowWindow.Edge.Left) leftTop.x = globalMouse.x // TODO... control.x = leftTop.x control.width = rightBottom.x - leftTop.x }Currently, I just have written the code for resizing when mouse presses on left edge of my
Window. AndedgeFlaghere represents the position of mouse. Now, there are two problems.- Resizing only works when I move the mouse press on the left edge to the right, i.e. shrink the window.
- Window shakes violently when resizing.
Can anyone help me?
-
I'm trying to create a resizable frameless window. In
onPositionChangedof aMouseAreathat fills entireWindow, here is part of my codeif (resizable && cursorShape !== Qt.ArrowCursor) { // resize var leftTop = Qt.point(control.x, control.y) var rightBottom = Qt.point(control.x + width, control.y + height) var globalMouse = mapToGlobal(Qt.point(mouseX, mouseY)) if (edgeFlag & ShadowWindow.Edge.Left) leftTop.x = globalMouse.x // TODO... control.x = leftTop.x control.width = rightBottom.x - leftTop.x }Currently, I just have written the code for resizing when mouse presses on left edge of my
Window. AndedgeFlaghere represents the position of mouse. Now, there are two problems.- Resizing only works when I move the mouse press on the left edge to the right, i.e. shrink the window.
- Window shakes violently when resizing.
Can anyone help me?
@Kamichanw you can do it simply with
QWindow::startSystemResize(and its friend startSystemMove) -
@Kamichanw you can do it simply with
QWindow::startSystemResize(and its friend startSystemMove) -
K Kamichanw has marked this topic as solved on