PDA

View Full Version : Qt classes in a callback function



Luc4
13th May 2010, 14:28
Hi! I'm using a function of a library which calls a callback function at a certain point. This callback function is defined like:

static void __stdcall function(...);

I'm trying to use Qt classes inside, but it seems it's not working. QMessageBox says I'm not in the GUI thread so I can't create messageboxes. I tried to use QImage and QPixmap, but it seems no image can be loaded. Do you have any idea why?
Thanks!

wysota
13th May 2010, 14:47
If Qt insists you are not in the GUI thread then you probably are not in the GUI thread :) You can post an event to an object in the gui thread to do the task for you.