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. Is it possible to automatically apply kinetic scrolling to every scrolling widget in an app?

Is it possible to automatically apply kinetic scrolling to every scrolling widget in an app?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 387 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.
  • R Offline
    R Offline
    rrd0
    wrote on last edited by rrd0
    #1

    I know QScroller is the class I need to use to enable kinetic scrolling for my scrolling widgets. I also know that the following line of code is what I need to add kinetic scrolling to the object scrollArea.

    QScroller::grabGesture(scrollArea, QScroller::LeftMouseButtonGesture);
    

    My question is:

    Is there a way of adding kinetic scrolling to every scrolling widget in my app without repeating the line above for every widget?

    I'm not saying would be hard to do that. What may be hard is detecting which widgets will grow to the point of needing scrolling. So, if exists a more scalable solution, I'd like to know.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You can use QObject::findChildren to get all QScrollAreas of your application and apply that line on them.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2

      • Login

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