The problem is that the thumbnail generator thread operates on QPixmaps and you can use these only in the GUI thread (it's because the data resides in X server). Use QImages instead.
The problem is that the thumbnail generator thread operates on QPixmaps and you can use these only in the GUI thread (it's because the data resides in X server). Use QImages instead.
jayke (21st February 2008)
Thanks a lot for your quick reply. I've searched the Qt docs for what you've said and it seems to be right. QPixmap do rely on the underlying window structure, which can, like all GUI stuff, only be manipulated by the primary thread.
So I've changed the QPixmap to QImage, performed the scale operation on it, and sent back the rescaled QImage to the primary thread, where I convert it to pixmap and put it on my label.
Next problem I've encountered was that when selecting image1 then image2 while it's still calculating, the image1 thumbnail shows up, while it's supposed to be the thumb from image 2. This has to do with the thread still running, but I'll manage to work my way around that.
Bookmarks