QScroller. How to caontrol scrolling?
Unsolved
General and Desktop
-
Hello everyone.
I have QScrollArea, with QWidget as background widget and some QPushButtons childed from QWidget.
Looks like this:
https://i.stack.imgur.com/AU3Y7.jpgFor all area i have setup scroller via
QScroller::grabGesture(viewport(), QScroller::TouchGesture);
So main question is: how to make scroll smoothly stop with my buttons in center?
-
I believe you are looking for scroll snapping.
You should investigate this method void QScroller::setSnapPositionsX(const QList<qreal> &positions)