tinesoft / cute-collage

A photo collage application powered by Qt framework
2 stars 1 forks source link

QPixmap: It is not safe to use pixmaps outside the GUI thread #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

i've succesfully built cute-collage from source.
But when i attemp to insert photos (on any kind/format) cute-collage
always told me "The following photos could not be added"
If i start cute-collage from a Terminal window i can read this when i attempt 
to add photos:

QPixmap: It is not safe to use pixmaps outside the GUI thread
QPixmap: It is not safe to use pixmaps outside the GUI thread
QPixmap: It is not safe to use pixmaps outside the GUI thread

Why? I miss something?

Original issue reported on code.google.com by musical...@gmail.com on 7 Mar 2013 at 11:27

GoogleCodeExporter commented 9 years ago
I forget to say:

Operating system: Haiku
Qt version: 4.8.5

Original comment by musical...@gmail.com on 7 Mar 2013 at 11:48

GoogleCodeExporter commented 9 years ago
Hi, thanks for reporting the issue.

I already know why it is not working. To put it in a nutshell, cute-collage 
uses additional workers(threads) to add the images in the application, in other 
not to block the GUI during this long operation.

Those images are represented by QPixmap objects. But unlike QImage, QPixmap are 
not safe to use outside the main thread ( i.e the GUI thread).

On Windows OS, the message you see in your console is just a warning, and does 
not prevent the photos to be imported.
But on Linux-based OS, its more severe and the photos are not added at all.

The solution will be to replace Qpixmap by QImage in those threads.

 I will look into that when I have more time. 

Original comment by kondotine on 7 Mar 2013 at 12:10

GoogleCodeExporter commented 9 years ago
Many thanks to you for your time!

I hope to use soon Cute-Collage, since is a nice app! :-)

Original comment by musical...@gmail.com on 7 Mar 2013 at 12:19