Solved How to forward Wheel events to parent of TableView?
-
I have this
ListView { ... TableView { ... } }
If i use mouse's wheel over
TableView
the parent componentListView
do not scroll of the mouse wheel event.
What solution could be for this? -
@Kofr How did you capture mouse events for
TableView
? -
@p3c0 with defauld
TableView
's interaction. I do not use any custom delegates or something.
So when I roll the wheel the whel actions are consumd by `TableView even if it is not scrollable. -
@Kofr Can you show us the wheelEvent function in your tableview? It sounds like you are taking the events even when you don't want them.
If you don't accept the event during times where you don't want to handle them it will move on to the next event handler. I.e.
event->setAccepted(false)
. -
@Kofr I'm too not sure how to foward these events without
MouseArea
. I suppose these mouse areas are in the default implementation which we cannot modify.
Btw. why do you have such requirement where these 2 views overlap ? -
@p3c0 I have
TableView
as a delegate ofListView
-
@Kofr Try
pressDelay
. For eg.pressDelay: 1000
-
@p3c0 it works perfectly. thank you!
-
-
@ambershark Thanks. I'm still learning :)
pressDelay
as the name says allows the Item to wait for a certain period of time before it propagates events to the children i.e the delegates. If not specified the events are instantly sent to the children and then never propagated back unless we add any such functionality which we can't in the default implementation. -
I would have used
interactive: false
that seems much more suited for your problem and obvious unless I don't understand your problem. -
@GrecKo
interactive
property blocks all events, in my casepressDelay: 500
make it work with clicks but not with wheel events. Tricky thing however.