Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.0
-
None
-
-
6857ad3e686a5e2b45d28a7f47dca3210608da50 (qt/qtdeclarative/dev) 2acb31641fc9c34d24ac29232cdfec2673834629 (qt/qtdeclarative/5.15)
Description
In QML I have a ListView with a header catching mouse events. If the ListView has the property clip = true and headerPositioning = ListView.OverlayHeader the mouse events are not catched.
With clip = false, it behaves as expected.
The same happens with the footer.
In Qt 5.13 it behaves as expected.
Example:
import QtQuick 2.9 import QtQuick.Layouts 1.15 import QtQuick.Window 2.15 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") ListModel { id: myModel ListElement { name: "Element 1"} ListElement { name: "Element 2"} ListElement { name: "Element 3"} ListElement { name: "Element 4"} ListElement { name: "Element 5"} ListElement { name: "Element 6"} } ListView { anchors.fill: parent model: myModel clip: true headerPositioning: ListView.OverlayHeader footerPositioning: ListView.OverlayHeader delegate: Text { height: 100 text: name } header: Rectangle { width: parent.width height: 50 z: 2 color: "blue" MouseArea { anchors.fill: parent onClicked: { console.log("header onClicked") } } } footer: Rectangle { width: parent.width height: 50 color: "red" z: 2 MouseArea { anchors.fill: parent onClicked: { console.log("footer onClicked") } } } } }
Attachments
Issue Links
- duplicates
-
QTBUG-82869 DragHandler in ListView.header (in conjunction with RowLayout, Repeater) doesn't work anymore
-
- Closed
-
-
QTBUG-85130 Button in clipped ListView header not receiving mouseEvent with headerPositioning ListView.OverlayHeader
-
- Closed
-
- is duplicated by
-
QTBUG-85223 ListView "clip" steals mouse clicks from header item
-
- Closed
-
-
QTBUG-84798 MouseArea in header of ListView doesn't work with OverlayHeader
-
- Closed
-
- resulted from
-
QTBUG-74046 Events stealing happens for MouseArea in some cases (preventStealing == true)
-
- Closed
-