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

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


Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Remy Lebeau