high_flyer
16th June 2009, 14:49
Hi,
I need some advice regarding the following problem:
I have a DLL that delivers images from a camera.
This is being done in an external thread, and my application is being notified by a callback the image acquisition thread is calling.
In that callback I have the ability to retrieve the new image buffer.
And at that point I am facing my problem:
If (while in the callback) I try to update my GUI (by using QLabel::setPixmap() with the new image, I get the debug message:
"QPixmap: It is not safe to use pixmaps outside the GUI thread"
which makes perfect sense, since indeed I am not in the GUI thread, but in the callback, which is in the image acquisition thread context.
But how then, can I let my application know when it should refresh it self with the new image , from an external thread?
Thanks in advance!
I need some advice regarding the following problem:
I have a DLL that delivers images from a camera.
This is being done in an external thread, and my application is being notified by a callback the image acquisition thread is calling.
In that callback I have the ability to retrieve the new image buffer.
And at that point I am facing my problem:
If (while in the callback) I try to update my GUI (by using QLabel::setPixmap() with the new image, I get the debug message:
"QPixmap: It is not safe to use pixmaps outside the GUI thread"
which makes perfect sense, since indeed I am not in the GUI thread, but in the callback, which is in the image acquisition thread context.
But how then, can I let my application know when it should refresh it self with the new image , from an external thread?
Thanks in advance!