Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.3, 6.4.1, 6.5.0
-
-
dc30e3859 (dev), a493aacc3 (6.5)
Description
Please find the attached example code.
If you run it with Qt5.15.x, you will be able to drag the modal Popup around using mouse.
And the same does not work correctly if you compile and run with Qt6.3.x, Qt6.4.x or Qt6.5.0
The Popup can be dragged around with mouse in Qt6 version if we do not set the property `modal: true`
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Button { text: "Open" onClicked: popup.open() anchors.horizontalCenter: parent.horizontalCenter y: 10 } component CPopup: Popup { id: cPopup width: 400 height: 300 closePolicy: Popup.NoAutoClose Component.onCompleted: { x = parent.width / 2 - width / 2 y = parent.height / 2 - height / 2 } background: Rectangle { id: backgroundRect color: "#505050" Rectangle { width: parent.width height: 30 color: "#2e2e2e" MouseArea { enabled: true propagateComposedEvents: true anchors.fill: parent property point pressedPosition: Qt.point(0, 0) onPressed: function(mouse){ console.log("Presssed...") pressedPosition = Qt.point(mouse.x,mouse.y) } cursorShape: Qt.OpenHandCursor onPositionChanged: function(mouse){ console.log("Moving...") var delta = Qt.point(mouse.x - pressedPosition.x, mouse.y - pressedPosition.y) cPopup.x += delta.x; cPopup.y += delta.y; } } } } Button { text: "Close" onClicked: cPopup.close() anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter } } CPopup { id: popup modal: true // commenting out this line will enable us to drag around } }
Attachments
Issue Links
- replaces
-
QTBUG-93649 Regression 5.15.3->6.0.0: Mouse Events not accepted on a MouseArea placed inside Popup::background
- Closed
For Gerrit Dashboard: QTBUG-113853 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
480591,3 | Fix mouse handling issue in modal popup | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
480740,2 | Fix mouse handling issue in modal popup | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
480741,5 | Fix mouse handling issue in modal popup | 6.4 | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
480742,2 | Fix mouse handling issue in modal popup | 6.3 | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |