I get this error while trying to use QtConcurrent
:
Cannot take the address of an rvalue of type 'qlonglong' (aka 'long long')
I'm trying to compute the size of a folder. I made a method that returns the size, which is of type qlonglong
. I want to run this method in another thread, which is QtConcurrent
, but I get the error.
QFuture<qlonglong> future = QtConcurrent::run(this,&backD::analysa());
You are trying to call
analysa()
and then take the address of its return value. You need to instead take the address ofanalysa
itself. To do that, simply remove the parenthesis from it: