我尝试多次调用函数,但使用QtConcurrent::mapped
但我无法克服错误:
error: no matching function for call to object of type 'addWrapper'
*result = map(*it);
^~~
代码如下:
struct addWrapper {
loadbook *instance;
typedef QString result_type;
addWrapper(loadbook *lBook) : instance(lBook) {}
QString operator()(QString &item) {
instance->decrypt->decryptFile(item,'A');
}
};
addWrapper wrapper(this);
QFuture<QString> returnContent = QtConcurrent::mapped(fileList,wrapper);