Uhm, still troubles... :-s
I've added a simple function as you were suggesting:
// Function which provide to run a thread
void SimulatorEngine::runThread(Team *team) {
team->performAllTests();
}
// Function which provide to run a thread
void SimulatorEngine::runThread(Team *team) {
team->performAllTests();
}
To copy to clipboard, switch view to plain text mode
Now, when I try to run the blockingMapped() function in this way:
QtConcurrent::blockingMapped(teamsList, teamsList+POPULATION_SIZE, runThread);
QtConcurrent::blockingMapped(teamsList, teamsList+POPULATION_SIZE, runThread);
To copy to clipboard, switch view to plain text mode
(teamsList is a QList<Team*> and POPULATION_SIZE is a constant having value 100) I get an error saying: "no match for 'operator+' in '((SimulatorEngine*)this)->SimulatorEngine::teamsList + 100'".
I reckon that what you intend to do using the three inputs form of blockingMapped() is to provide a range of memory, going from the first element of teamsList to the last one. Even if I use the two parameters syntax, like:
QtConcurrent::blockingMapped(teamsList, runThread);
QtConcurrent::blockingMapped(teamsList, runThread);
To copy to clipboard, switch view to plain text mode
I still get an error saying: "no matching function for call to 'blockingMapped(QList<Team*>&, <unknown type>)'".
Maybe the runThread() function must be inside the Team class?
Bookmarks