[Qt-interest] QHash for QImage

Agus Syawal alfonsus_agus at yahoo.com
Wed Feb 17 11:32:39 CET 2010


Hi all,
I make a procedure which buffers QImage object from Poppler. As you know, each pdf page is rendered as an image by Poppler.
This buffer is created to contain 10 images. The buffer is QHash<int, QImage> type.
So here I have a for loop:

for (i = startPage; i < endPage; i++) {
   buffer.insert(startPage, poppler->getImage(startPage));
}

In several case, I found that buffer.contains(page) return TRUE, but the Image I got from buffer.value(page) is a null image.
I put some debug statement before I put the image into buffer, and it is not null.
But when I try to get the image from buffer, sometimes it returns null image.

Can anyone enlighten me how to avoid this problem?

Thank you,
Agus S Y



      



More information about the Qt-interest-old mailing list