Results 1 to 2 of 2

Thread: Problem with QPixmapCache

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Posts
    38
    Thanks
    29
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Problem with QPixmapCache

    Hi,everyone!
    I draw a large amount of point in pixmap. and then draw pixmap onto qgraphicsview which last was placed in a gridlayout. And when i resize the window, paintEvent is recalled which bring the repaint of large points on the pixmap. So i took QPixmapCache into account, and i use QPixmapCache::remove(key,pixmap) when there really need to repaint the pixmap such as point data changed, after drawing points on the pixmap ,and i use QPixmapCache::insert(key,pixmap) into the cache again. As we all know that QGraphicsview:aintEvent() is automatically recalled by Qt when you move mouse or use resizeEvent() , so as long as there's no need to repaint pixmap ,i just fetch the pixmap from the cache each time and the use drawPixmap(0,0, pixmap). And yes ,it really got what i need , it has enhance the speed.

    but here came the problem, there only show a corner graphics of the pixmap whenever how i resize the window use resizeevent. but i have validated that i have draw all points in the pixmap and store it into the cache successfully when the data first come. Why i use resizeEvent, but the visible graphics of the pixmap hold in line with the same graphics when the wigdet is shown at first? Why? I'm sure that i have paint all the points in the pixmap completely. and i do can store and fetch from the cache.

    Wish your help please. this problem has trouble me several days.Thank your very much!

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

    Default Re: Problem with QPixmapCache

    Could we see some code related to all that? Maybe you could prepare a minimal compilable example reproducing the problem?
    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.


Similar Threads

  1. Replies: 1
    Last Post: 23rd April 2009, 09:05
  2. Replies: 19
    Last Post: 3rd April 2009, 23:17
  3. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  4. Problem with receiving events from QDateEdit
    By gunhelstr in forum Qt Programming
    Replies: 4
    Last Post: 20th April 2006, 11:21
  5. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36

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
  •  
Qt is a trademark of The Qt Company.