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. Smooth automatic scrolling in QScrollArea (or something else?)
QtWS25 Last Chance

Smooth automatic scrolling in QScrollArea (or something else?)

Scheduled Pinned Locked Moved Unsolved General and Desktop
scrollinganimationlagcpugpu
4 Posts 2 Posters 3.4k Views
  • 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.
  • K Offline
    K Offline
    kryptur
    wrote on last edited by
    #1

    Hello,
    I'm quite new to QT and have a problem with a QScrollArea animation:
    I want the content of the QScrollArea smoothly scroll down automatically over several seconds.
    For now I tried this by using a QTimer that calls ensureVisibility(0, top, 0, 0) every few milliseconds (15-30) and increases the top-value by 1 or 2 Pixels per call.

    Inside the QScrollArea I want to display a "table-like" structure. The only use of this program is to present the displayed information.

    When using my "solution" (its more like a first attempt) the CPU usage is about 20% on my Laptop - but it works
    Because I want this to run on a Raspberry-Pi, my program has massive lags.

    While still having problems with getting QT5 with EGL on my Raspberry Pi, the application opens with linuxfb or in x-server - but instead of scrolling the screen in about 15 seconds you have to wait a minute to see it move about 2 pixels.

    The full test code is available here: https://github.com/MyTFG/raspVtp

    What can I do to reduce the CPU usage and/or make it run smoothly?

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

      Hi and welcome to devnet,

      Since it's tabular data, why not use a QTableView ?

      By the way it's Qt, QT stands for Apple QuickTime.

      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
      0
      • K Offline
        K Offline
        kryptur
        wrote on last edited by
        #3

        Hi, thank you for your response :)
        I could use a QTableView - but I guess this would not solve my problem with scrolling, since i have to move the content there as well or am I wrong with this?

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

          The rendering part of the QTableView is optimized for that kind of data. After a quick look at your code, it seems you are generating lots of widgets to show your data, here you would only have one.

          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
          0

          • Login

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