Results 1 to 4 of 4

Thread: Hande a *lot* of pixmaps (Qt4.4)

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Hande a *lot* of pixmaps (Qt4.4)

    Hey guys I have a list of 10 000 contacts. Each one has its one avatar's picture.

    I'm displaying them in a QListView.

    How can I avoid keeping everything in memory without sacrificing performances ?

    Thanks.

  2. #2
    Join Date
    May 2008
    Location
    London, UK
    Posts
    8
    Thanked 6 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hande a *lot* of pixmaps (Qt4.4)

    How can I avoid keeping everything in memory without sacrificing performances ?
    I would think that the short answer is that you cannot keep all the images out of memory, and still get the best performance. However, I havce a few ideas below:


    • In a typical use, will the user actually see all 10000 images ont he screen? I.e.- will they scroll down to the bottom of your list widget? If not, then you could try only loading the images on the screen at the time, although that might cause slowdown while scrolling the list widget. To avoid this, perhaps you could load the pixmap data in another thread...
    • Are all 10,000 images unique? If not, perhaps just load the images once, and store references / pointers to them.
    • Reduce the memory usage by reducing the size of the pictures.

    This may not be useful to you, but one way to generate a large number of unique avatar pictures for inline forums etc. is to have a list of foreground and background pictures. The user can pick one of each, and you then composite the foreground and background pictures. This way, you can define 10 background, and 10 foreground pictures, thereby giving you a total of 100 unique pictures. This also reduces the memory requirements when you need to load them all...


    Hope this helps!

  3. #3
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Hande a *lot* of pixmaps (Qt4.4)

    Quote Originally Posted by bunjee View Post
    Hey guys I have a list of 10 000 contacts. Each one has its one avatar's picture.
    I'm displaying them in a QListView.
    How can I avoid keeping everything in memory without sacrificing performances ?
    Thanks.
    I fill a sqlite database with 6000 tumbnail and big image 2-6 evry contact
    to display each 500 to 500 row tumbnail people wait 1.5 / 2 second... on limit 100 is quick..

  4. #4
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Hande a *lot* of pixmaps (Qt4.4)

    You could use proxy model and load thumbnails on per page basis ...
    Qt 5.3 Opensource & Creator 3.1.2

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.