Emit signal from another thread to Wt main thread with parameters
Hello! As far as I know I can't use Wt signal/slots system outside Wt main thread because WApplication::instance doesn't exist in other threads. So I need somehow pass data from another thread to my widget. I need something similar to PostedSignal from http://redmine.webtoolkit.eu/boards/1/topics/5182 but with parameters.
If Wt signal/slots system works outside main thread it will looks like this:
/* main gui class */
class SomeCustomWidget: public WContainerWidget
void onDataChanged(int value);
/* ctrl live in another thread */
What is the best way to solve my problem?
Updated by Wim Dumon almost 10 years ago
call post in combination with boost::bind.
Wt::WServer::instance()->post(sessionId, boost::bind(myFunction, myParameter));
where m_myFunction is a function accepting one parameter.
Updated by Koen Deforche over 9 years ago
- Status changed from New to InProgress
- Assignee set to Wim Dumon
Updated by Vitaly Volochay over 9 years ago
Thanks, I solve my problem.
Updated by Wim Dumon over 9 years ago
- Status changed from InProgress to Closed