Drawer behaves different when using a physical mouse, and when using a touchscreen
-
I created a very simple application using Qt6.3 and Ubuntu 20 that displays a drawer with a red square, when swiped from the left like this:
Item { Rectangle { color: "blue" anchors.fill: parent } Drawer { edge: Qt.LeftEdge y: 50 height : 500 width: 500 enabled: true dragMargin: 25 background: Rectangle { color: "black" opacity: 0.25 } Behavior on opacity { NumberAnimation{ duration: 500} } Rectangle { color: "red" anchors.centerIn: parent visible : true width: 100 height: 100 } Label { text: "test" anchors.centerIn: parent } onVisibleChanged: { console.log("visible changed of drawer: " + visible) } } }
I put this example on a touchscreen with a physical mouse attached to it and observed different behaviour:
When dragging with a physical mouse, the drawer opens and closes normally. If I click beneath the drawer region, nothing happens, if I click on the right of the drawer region, the drawer closes. Nothing strange so far.
When I drag on the touchscreen, the drawer opens and closes correctly. When clicking on the right region of the drawer when it is open, it closes as it should. When clicking beneath the drawer when it is open, the drawer does not close, but after I've clicked beneath the drawer, the drawer is not able to close any more by dragging it. If I press esc on the keyboard, the drawer closes again, but If I then want to open the drawer again, I can see my log message: visible changed of drawer: true, but it is not displayed. After dragging the drawer in view again with my physical mouse, I can close and open the drawer again with the touchscreen.
What could be the issue here? Is this a Qt6 bug, or could this be something different?
-
this is now marked as a bug:
https://bugreports.qt.io/browse/QTBUG-103811