Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QScroller. How to caontrol scrolling?
Qt 6.11 is out! See what's new in the release blog

QScroller. How to caontrol scrolling?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 674 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    goldstar2154
    wrote on last edited by
    #1

    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.jpg

    For 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?
    0_1513606534218_1513606515125.jpg

    1 Reply Last reply
    0
    • E Offline
      E Offline
      Eligijus
      wrote on last edited by
      #2

      I believe you are looking for scroll snapping.
      You should investigate this method void QScroller::setSnapPositionsX(const QList<qreal> &positions)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved