0

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());
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 2
    Looks like you want to pass in ta pointer to the method `backD::analysa`, but the brackets on the end of `&backD::analysa()` invoke the method instead. Remove the brackets. – user4581301 Mar 30 '22 at 17:36

1 Answers1

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);
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770