Cannot take the address of an rvalue of type 'qlonglong' (aka 'long long')

138 views Asked by At

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());
1

There are 1 answers

0
Remy Lebeau On

You are trying to call analysa() and then take the address of its return value. You need to instead take the address of analysa itself. To do that, simply remove the parenthesis from it:

QFuture<qlonglong> future = QtConcurrent::run(this,&backD::analysa);