Have strange situation with ListView
scrolling on mouse wheel. Have Items structure similar to this:
MainAppWindow {
// Some zoomable map item
Map {
anchors.fill: parent
}
PopupMenu { // Simple Rectangle item
anchors.top: parent.top
width: 200
height: parent.height / 2
z: parent.z + 1
ListView {
anchors.fill: parent
clip: true
...
delegate: Item {
...
MouseArea {
anchors.fill: parent
onClick: {
someHandler()
}
}
}
}
}
}
ListView
with vertical scroll works and scrolls just fine until it stops at bounds (top or bottom - whatever) and after this mouse event starts to propagate to underlying layer and ZoomableMap
starts to zoom which is not we want: should be propagated there only if PopupMenu
is not visible. Adding
onWheel: wheel.accepted = true
into MouseArea
inside ListView
delegate could partially solve the problem - it disables wheel and allows scrolling only by dragging the content. However better allow scrolling by the wheel as well. MouseArea
in PopupMenu
blocks wheel and dragging in the ListView
completely as well - not helps also.
So what is problem here, how to fix? Or we doing something wrong here?
ZoomableMap
whenPopupMenu::visible == true
? (Need anid
for the popup, of course.) IdeallyZoomableMap
would have some property for that... in which case it's probably the simplest option. – Maxim PapernoMouseArea
intoZoomableMap
which blocks all mouse events and is disabled by default and enable it only if popup is visible. Ids exist of course. – Aleksey Kontsevich