Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.7.0 Beta3
-
None
-
-
365cb95a7 (dev), 762906700 (6.8)
Description
I was trying out a simple use case to have a movable window inside main window. here is my code snippet.
// code placeholder import QtQuick import QtQuick.Controls Window { id: mainWindow width: 640 height: 480 visible: true Window { id: childWindow color: "steelblue" parent: mainWindow visible: true flags: Qt.FramelessWindowHint MouseArea { anchors.fill: parent property var clickPos: Qt.point(0, 0) onPressed:(mouse) => { clickPos = Qt.point(mouse.x,mouse.y) } onPositionChanged: (mouse) =>{ var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y) childWindow.x += delta.x; childWindow.y += delta.y; } } Column { anchors.centerIn: parent Label { anchors.horizontalCenter: parent.horizontalCenter text: `Drag to move !\n${childWindow.x}, ${childWindow.y}` } Button { text: childWindow.parent === null ? "Attach" : "Detach" onClicked: { childWindow.parent = childWindow.parent === mainWindow ? null : mainWindow } } } } }
If I detach the widow and drag it using the MouseArea the window moves fine, but if I do the same when it is being inside, I see weird flickering because of wrong position while dragging.
CC: vestbo
Attachments
Issue Links
- resulted from
-
QTBUG-102835 Enable embedding foreign UI elements in Qt Quick UIs
- Open