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. QT android app slow scrolling
Forum Updated to NodeBB v4.3 + New Features

QT android app slow scrolling

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.5k Views 2 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.
  • M Offline
    M Offline
    merlinko
    wrote on 27 Sept 2017, 14:54 last edited by
    #1

    Hello,

    I am trying to make a simple android app, but basically my problem is that on my main screen I have about 250 little images that i want to scroll. But I really need the scrolling to be fluent and fast. First I tried it using QML but it wasnt really fast, then I tried to make the app in qt designer and use widgets but that was very slow. Then I tried using openGL but on android I can only use openGL ES and I cant find so much examples because every example that I find is much more advanced than I need.

    But basically my main question is, what do you think is the best way to solve my problem and if its openGL which way of using it is the best that could solve it?

    Thank you.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 28 Sept 2017, 05:55 last edited by
      #2

      Some general remarks:

      • use lazy initialization - only load images when they are needed to be shown
      • use MVP (ListView/ GridView etc.) - this will ensure the view only instantiates visible items (whatever is "scrolled away" is destroyed to free up resources)
      • you can experiment with precaching the images, so that they are available in RAM, instead of reading them from SD card while scrolling
      • do not use SVG images, they are slow to render
      • optimize your images: scale them down, resize so that there is less data to load
      • use a profiler to identify performance bottlenecks

      I do recommend using QML for this, it should be able to handle the task. But that probably depends on the details of the task at hand. Maybe raw OpenGL could be a solution, but it would involve more work (and I can't help here because my OpenGL knowledge is minimal).

      (Z(:^

      1 Reply Last reply
      2
      • M Offline
        M Offline
        merlinko
        wrote on 28 Sept 2017, 11:41 last edited by
        #3

        I think I should add some more information. The images are not only images but they should be objects with some labels on them and user should be able to click them. I cannot use lazy initialization because it would be even slower. Today I tried MVP but only with the images as icons, but on android it was slow, on ios it was better. I use png images and their size is about 1kb and they are really scaled like icons.
        I am really desperate now because i think there must be a proper solution for this. :/

        Thanks for the answer btw :)

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 28 Sept 2017, 11:49 last edited by
          #4

          I cannot use lazy initialization because it would be even slower

          How so? If you initially load 20 items instead of 250, it has to work faster. Unless you need to show all 250 at the same time (is this app displayed on some huge screen?).

          I use png images and their size is about 1kb and they are really scaled like icons.

          That does not sound like a vexing task for Qt or the CPU/ GPU at all, I've worked with Qt QML apps which show even ~160MB of image data and it was all smooth. I begin to suspect there is something else which makes it run slow for you. Are images loaded from network, by any chance? Maybe you could post some small code snippet of how you attempt to do it, or some wireframe of how the solution should look? Then I could try giving some more concrete hints on how to improve the performance.

          (Z(:^

          1 Reply Last reply
          2

          3/4

          28 Sept 2017, 11:41

          • Login

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