{
content = decrypt->decryptFile(fileName, 'A');
return content;
}
QList<QString> test = QtConcurrent::map(fileList,&loadbook::decryptLoop);
QString loadbook::decryptLoop(QString &fileName)
{
QString content;
content = decrypt->decryptFile(fileName, 'A');
return content;
}
QList<QString> test = QtConcurrent::map(fileList,&loadbook::decryptLoop);
To copy to clipboard, switch view to plain text mode
Hope this is re-entrant.
now the errors are
/Users/user/LearnOn/loadbook.cpp:159: error: no viable conversion from 'QFuture<void>' to 'QList<QString>'
QList<QString> test = QtConcurrent::map(fileList,&loadbook::decryptLoop) ;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/QT/5.4/clang_64/lib/QtConcurrent.framework/Headers/qtconcurrentmapkernel.h:63: error: no matching function for call to object of type 'QtConcurrent::MemberFunctionWrapper1<QString, loadbook, QString &>'
map(*it);
^~~
Added after 28 minutes:
I tried with mappedReduced
QFuture<QString> test = QtConcurrent::mappedReduced(fileList,&loadbook::decryptLoop,&loadbook::joinContent);
test.waitForFinished();
{
content = decrypt->decryptFile(fileName, 'A');
return content;
}
reduceResult += partial;
}
QFuture<QString> test = QtConcurrent::mappedReduced(fileList,&loadbook::decryptLoop,&loadbook::joinContent);
test.waitForFinished();
QString loadbook::decryptLoop(QString &fileName)
{
QString content;
content = decrypt->decryptFile(fileName, 'A');
return content;
}
void joinContent(QString &reduceResult, const QString &partial) {
reduceResult += partial;
}
To copy to clipboard, switch view to plain text mode
getting the below error
/Users/user/LearnOn/loadbook.cpp:161: error: no matching function for call to 'mappedReduced'
QFuture<QString> test = QtConcurrent::mappedReduced(fileList,&loadbook::de cryptLoop,&loadbook::joinContent);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
Bookmarks