Hello, this is my frist post and I need your help
Im doing a gui by using third-party library but I have a problem. I will do an example to be clear:
Qt Code:
#include <iostream> #include ... Test::Test() { cout << "Constructor called" << endl; } Test::method() { lib->doSomething(); data = lib->getData(); ... // use data returned from the method and update gui }To copy to clipboard, switch view to plain text mode
The problem is the method doSomething() doesn't return immedialty wot I want but it takes few secs. So when it calls getData(), data variable doesn't contain the right thing.
I think I should implement something like qmutex or qwaitcondition to wait doSomething() method finish. Can someone explain me how to do that, please? And how does it work?
Thank you very much
Bookmarks