QtConcurrentRun and global function
Hello, I am having some global functions in a separate glob.h file included in the *.cpp files that need to use these functions...
My question is, how can I start one of these global functions using qtconcurrentrun while these functions don't have a parent?
For example, for a normal use, I would call
Code:
QtConcurrent::run(this, &MainWindow::my_function);
But the global function isn't in 'this' object and doesn't have a class (like MainWindow)...
I tried with NULL instead of 'this' and simply function's name as second argument...
I am not sure who to use it.... Anybody with an idea :D ?
Re: QtConcurrentRun and global function
Why not like this:
Code:
void someFunction(){
...
}
QFuture<void> f = QtConcurrent::run(someFunction);
Its in the docs :)
Re: QtConcurrentRun and global function
It was that simple :P Thanks :)