Results 1 to 11 of 11

Thread: QListView unresponsive when painting images

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2015
    Posts
    6
    Thanks
    1

    Default Re: QListView unresponsive when painting images

    I just made a new discovery!
    While surfing on the net I stumbled upon QPixmapCache. While thinking it was the solution to my issue, i set it up.
    Unfortunately the issue still remains, but i discovered a symptom.
    To be sure i setup the caching correctly i made it print "from cache", "new image" depending on if the image was fetched from the cache, or was created anew.
    This showed some interesting results. On start it printed "new image" about 15 times as expected. I Expected 15 times because i set the limit in the fetchMore
    method to 15.
    Then i try moving the mouse inside the ListView, without scrolling, just moving the mouse around abit. This made the console go wild with alot of mixed messages of
    "from cache" and "new image", which about 60-70% of the messages were "new image". With this i think i finally narrowed down the cause of why the gui is lagging.
    It suggests that somehow the view is not only painting the needed (visible) images, but everything when you move your mouse inside the view.
    This however hasn't solved my problem, so please don't think that i still don't need help. I just wanted to give an update on what i have found.
    Last edited by isplasher; 5th May 2015 at 17:39.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QListView unresponsive when painting images

    What happens if you increase the size of the pixmap cache?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2015
    Posts
    6
    Thanks
    1

    Default Re: QListView unresponsive when painting images

    Quote Originally Posted by wysota View Post
    What happens if you increase the size of the pixmap cache?
    Wow, so i just multipled the cache with 1000 (10240*1000) and it helped alot.
    The gui was still lagging but not as much as before.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QListView unresponsive when painting images

    Quote Originally Posted by isplasher View Post
    Wow, so i just multipled the cache with 1000 (10240*1000) and it helped alot.
    The gui was still lagging but not as much as before.
    The effect you observed before was caused by cache flickering. How large are your images? Isn't the lagging caused by scaling pixmaps?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Apr 2015
    Posts
    6
    Thanks
    1

    Default Re: QListView unresponsive when painting images

    Quote Originally Posted by wysota View Post
    The effect you observed before was caused by cache flickering. How large are your images? Isn't the lagging caused by scaling pixmaps?
    Oh i see.. I completely forgot about the image size.
    The images i use mostly have the dimensions 1500x2100px. They are about 2mb each.
    After reading that i now realize why all this was happening.. (facepalms)
    Anyway, yes, i think you're right about the pixmap scaling. Do you have any solutions, other than using smaller images?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QListView unresponsive when painting images

    Scale them once before adding them to your model and use the thumbnail instead of the original image.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. The following user says thank you to wysota for this useful post:

    isplasher (5th May 2015)

  8. #7
    Join Date
    Apr 2015
    Posts
    6
    Thanks
    1

    Default Re: QListView unresponsive when painting images [Solved]

    Right.
    Was thinking of the same approach.
    Thank you for your help, kind sir.

Similar Threads

  1. Replies: 8
    Last Post: 17th May 2012, 11:09
  2. QSharedMemory, signals and QBuffer
    By sky in forum Qt Programming
    Replies: 1
    Last Post: 23rd November 2011, 05:06
  3. QBuffer::readLine()
    By vfernandez in forum Qt Programming
    Replies: 2
    Last Post: 23rd April 2010, 20:57
  4. how can convert QFile to QBuffer?
    By learning_qt in forum Qt Programming
    Replies: 3
    Last Post: 16th November 2009, 13:34
  5. QBuffer bytesWritten() problem
    By QAlex in forum Qt Programming
    Replies: 3
    Last Post: 29th September 2009, 09:05

Tags for this Thread

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.