c++multithreadingqtqtconcurrentqfuture

how to run a membber function with QtConcurrrent Qt6? type 'decay_t cannot be used prior to '::' because it has no members)


i'm trying to run a member function but but i got an error , help me please

i tried with this line of code

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

this is a screen shot 'lol' of the errors and analysa() is a methode that returns a qlonglong


Solution

  • Try QtConcurrent::run([this]{ return analysa(); }); or QtConcurrent::run([this] -> qlonglong { return analysa(); });, whichever compiles in your case.