ScrollOnDrag

#1

Hi there,

is there any way of temporally disabling ScrollOnDrag in a viewport? I have a listbox containing swipe components and would like to stop vertical scrolling while swiping a row component, As far as I can see, the underlaying viewport uses a global mouse listener which means enabling interception of mouse events wouldn’t work.

Any help is much appreciated.
Joerg

0 Likes

#2

void setScrollOnDragEnabled (bool shouldScrollOnDrag)

what happens if you call that set to false during your initial swiping, and set it to true when you’re done swiping?

0 Likes

#3

Actually that is what I am doing right now - caching and restoring the old state - but I don’t really like it for the sake of nice and clean code. Casting the parent to a possible yiewport to do this doesn’t sound right to me.

0 Likes

#4

You can set the ignoreDrag flag for your listbox. Every component actually supports this. See Component::setViewportIgnoreDragFlag (bool ignoreDrag)

1 Like

#5

That is what I was missing. Thanks a bunch!

0 Likes

#6

This should probably get a mention somewhere in the documentation of viewport.

1 Like

#7

Yep, I’ll add that. Thanks for the suggestion.

0 Likes