QtConcurrent::run errors with Qt6
-
How to rewrite line (930) ffDiaporama-2.1/src/ffDiaporama/engine/_EncodeVideo.cpp in Qt6? (sf.net/p/ffdiaporama)
ThreadAssembly.setFuture(QtConcurrent::run(this,&cEncodeVideo::Assembly,Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue));
engine/_EncodeVideo.cpp:930:55: required from here 930 | ThreadAssembly.setFuture(QtConcurrent::run(this,&cEncodeVideo::Assembly,Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtCore/qfuture_impl.h:180:43: error: ‘operator()’ is not a member of ‘std::decay<cEncodeVideo*>::type’ {aka ‘cEncodeVideo*’} 180 | struct ArgResolver : ArgResolver<decltype(&std::decay_t<F>::operator())> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtaskbuilder.h:9, from /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/QtConcurrent:4, from ../ffDiaporama_lib/BasicDefines.h:85: /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentstoredfunctioncall.h: In instantiation of ‘struct QtConcurrent::PromiseTaskResolver<cEncodeVideo*, void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool>’: /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentstoredfunctioncall.h:211:8: required from ‘struct QtConcurrent::TaskResolverHelper<std::integral_constant<bool, false>, cEncodeVideo*, void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool>’ 211 | struct TaskResolverHelper<std::false_type, Function, Args...> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentstoredfunctioncall.h:217:8: required from ‘struct QtConcurrent::TaskResolver<cEncodeVideo*, void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool>’ 217 | struct TaskResolver : public TaskResolverHelper<typename std::is_invocable<std::decay_t<Function>, | ^~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentrun.h:44:76: required from ‘auto QtConcurrent::run(QThreadPool*, Function&&, Args&& ...) [with Function = cEncodeVideo*; Args = {void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*&, cDiaporamaObjectInfo*&, cSoundBlockList*, cSoundBlockList*, bool&}]’ 44 | return TaskResolver<std::decay_t<Function>, std::decay_t<Args>...>::run( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 45 | std::move(tuple), TaskStartParameters { pool }); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentrun.h:61:15: required from ‘auto QtConcurrent::run(Function&&, Args&& ...) [with Function = cEncodeVideo*; Args = {void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*&, cDiaporamaObjectInfo*&, cSoundBlockList*, cSoundBlockList*, bool&}]’ 61 | return run(QThreadPool::globalInstance(), std::forward<Function>(f), | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 | std::forward<Args>(args)...); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine/_EncodeVideo.cpp:930:55: required from here 930 | ThreadAssembly.setFuture(QtConcurrent::run(this,&cEncodeVideo::Assembly,Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentstoredfunctioncall.h:189:64: error: no type named ‘IsPromise’ in ‘struct QtPrivate::ArgResolver<cEncodeVideo*>’ 189 | static_assert(QtPrivate::ArgResolver<Function>::IsPromise::value, | ^~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentstoredfunctioncall.h: In instantiation of ‘static auto QtConcurrent::PromiseTaskResolver<Function, Args ...>::run(TaskWithArgs&&, const QtConcurrent::TaskStartParameters&) [with Function = cEncodeVideo*; Args = {void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool}; TaskWithArgs = std::tuple<cEncodeVideo*, void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool>]’: /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentrun.h:44:76: required from ‘auto QtConcurrent::run(QThreadPool*, Function&&, Args&& ...) [with Function = cEncodeVideo*; Args = {void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*&, cDiaporamaObjectInfo*&, cSoundBlockList*, cSoundBlockList*, bool&}]’ 44 | return TaskResolver<std::decay_t<Function>, std::decay_t<Args>...>::run( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 45 | std::move(tuple), TaskStartParameters { pool }); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentrun.h:61:15: required from ‘auto QtConcurrent::run(Function&&, Args&& ...) [with Function = cEncodeVideo*; Args = {void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*&, cDiaporamaObjectInfo*&, cSoundBlockList*, cSoundBlockList*, bool&}]’ 61 | return run(QThreadPool::globalInstance(), std::forward<Function>(f), | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 | std::forward<Args>(args)...); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine/_EncodeVideo.cpp:930:55: required from here 930 | ThreadAssembly.setFuture(QtConcurrent::run(this,&cEncodeVideo::Assembly,Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentstoredfunctioncall.h:195:15: error: no type named ‘PromiseType’ in ‘struct QtPrivate::ArgResolver<cEncodeVideo*>’ 195 | using PromiseType = typename QtPrivate::ArgResolver<Function>::PromiseType; | ^~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentstoredfunctioncall.h:196:17: error: no type named ‘PromiseType’ in ‘struct QtPrivate::ArgResolver<cEncodeVideo*>’ 196 | return (new StoredFunctionCallWithPromise<Function, PromiseType, Args...>(std::move(args))) | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentstoredfunctioncall.h: In instantiation of ‘struct QtConcurrent::PromiseTaskResolver<void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool>’: /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentstoredfunctioncall.h:211:8: required from ‘struct QtConcurrent::TaskResolverHelper<std::integral_constant<bool, false>, void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool>’ 211 | struct TaskResolverHelper<std::false_type, Function, Args...> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentstoredfunctioncall.h:217:8: required from ‘struct QtConcurrent::TaskResolver<void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&), cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool>’ 217 | struct TaskResolver : public TaskResolverHelper<typename std::is_invocable<std::decay_t<Function>, | ^~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentrun.h:44:76: required from ‘auto QtConcurrent::run(QThreadPool*, Function&&, Args&& ...) [with Function = void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&); Args = {cDiaporamaObjectInfo*&, cSoundBlockList*&, cSoundBlockList*&, bool&}]’ 44 | return TaskResolver<std::decay_t<Function>, std::decay_t<Args>...>::run( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 45 | std::move(tuple), TaskStartParameters { pool }); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentrun.h:61:15: required from ‘auto QtConcurrent::run(Function&&, Args&& ...) [with Function = void (cEncodeVideo::*)(cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&); Args = {cDiaporamaObjectInfo*&, cSoundBlockList*&, cSoundBlockList*&, bool&}]’ 61 | return run(QThreadPool::globalInstance(), std::forward<Function>(f), | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 | std::forward<Args>(args)...); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
Hi and welcome to devnet,
From a quick look at the documentation, you are not passing the arguments in the correct order. You need pass the member method first and then the rest of the parameters.
-
If I enter the right form
ThreadAssembly.setFuture(QtConcurrent::run(&cEncodeVideo::Assembly,this,Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue));
I get this error
engine/_EncodeVideo.cpp:930:55: required from here /usr/include/x86_64-linux-gnu/qt6/QtConcurrent/qtconcurrentstoredfunctioncall.h:189:64: error: static assertion failed: The first argument of passed callable object isn't a QPromise<T> & type. Did you intend to pass a callable which takes a QPromise<T> & type as a first argument? Otherwise it's not possible to invoke the function with passed arguments.
-
Can you provide a minimal example that shows that issue ?
It will be easier to check what might be going wrong. -
_EncodeVideo.cpp
bool cEncodeVideo::DoEncode() { ... if ((!PreviousFrame)||(PreviousFrame->RenderedImage.isNull())) ThreadAssembly.setFuture(QtConcurrent::run(&cEncodeVideo::Assembly,this,Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)); ... } void cEncodeVideo::Assembly(cDiaporamaObjectInfo *Frame,cDiaporamaObjectInfo *PreviousFrame,cSoundBlockList *RenderMusic,cSoundBlockList *ToEncodeMusic,bool &Continue) { ... }
-
Is cEncodeVideo::Assembly a member function?
Not sure QtConcurrent::run is able to bind together &cEncodeVideo::Assembly and the 'this' argument.
Try wrapping that part of the call into a lambda, or use std::mem_fn
Or some of the other arguments has a type mismatch. -
Is cEncodeVideo::Assembly a member function?
Not sure QtConcurrent::run is able to bind together &cEncodeVideo::Assembly and the 'this' argument.
Try wrapping that part of the call into a lambda, or use std::mem_fn
Or some of the other arguments has a type mismatch.@Asperamanca said in QtConcurrent::run errors with Qt6:
Is cEncodeVideo::Assembly a member function?
Not sure QtConcurrent::run is able to bind together &cEncodeVideo::Assembly and the 'this' argument.We do not know, because the OP has been asked to provide an example for us to check and they simply paste a couple of lines out of any context so nobody can tell....
-
In other files with QtConcurrent::run ffDiaporama 2.1 works well only not in _EncodeVideo.cpp.
gons@debian:~/Dokumente/_prog/_ffdiaporama/_qt6/_work_20250102/_work2/ffdiaporama-2.1$ find . -name '*' -type f -exec grep -q QtConcurrent::run {} \; -print ./src/ffDiaporama/wgt_QVideoPlayer/wgt_QVideoPlayer.cpp ./src/ffDiaporama/engine/_Diaporama.cpp ./src/ffDiaporama/engine/_EncodeVideo.cpp ./src/ffDiaporama/DlgExportProject/DlgExportProject.cpp ./src/ffDiaporama/DlgRenderVideo/DlgRenderVideo.cpp ./src/ffDiaporama/wgt_QMultimediaBrowser/QCustomFolderTable.cpp
-
It's a bit frustrating. You mention code we can't know, instead of providing sufficient source code to identify and name the problem (even when asked to do so).
I have given you leads on how to identify and fix the problem yourself, but you did not answer them. -
The code is here (ffDiaporama 2.1)
https://sourceforge.net/projects/ffdiaporama/files/ffdiaporama_bin_2.1.2014.0209.tar.gz
The translation in Qt6 is here
https://sourceforge.net/projects/ffdiaporama/files/qt6/ffdiaporama_2.1-1.diff.gz -
If I use
ThreadAssembly.setFuture(QtConcurrent::run([=]{Assembly(Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)}));
as solution corresponding to link text
I getengine/_EncodeVideo.cpp: In lambda function: engine/_EncodeVideo.cpp:930:89: error: invalid conversion from ‘const cSoundBlockList*’ to ‘cSoundBlockList*’ [-fpermissive] 930 | ThreadAssembly.setFuture(QtConcurrent::run([=]{Assembly(Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)})); | ^~~~~~~~~~~~ | | | const cSoundBlockList* engine/_EncodeVideo.h:126:111: note: initializing argument 3 of ‘void cEncodeVideo::Assembly(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&)’ 126 | void Assembly(cDiaporamaObjectInfo *Frame,cDiaporamaObjectInfo *PreviousFrame,cSoundBlockList *RenderMusic,cSoundBlockList *ToEncodeMusic,bool &Continue); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~ engine/_EncodeVideo.cpp:930:102: error: invalid conversion from ‘const cSoundBlockList*’ to ‘cSoundBlockList*’ [-fpermissive] 930 | ThreadAssembly.setFuture(QtConcurrent::run([=]{Assembly(Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)})); | ^~~~~~~~~~~~~~ | | | const cSoundBlockList* engine/_EncodeVideo.h:126:140: note: initializing argument 4 of ‘void cEncodeVideo::Assembly(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&)’ 126 | void Assembly(cDiaporamaObjectInfo *Frame,cDiaporamaObjectInfo *PreviousFrame,cSoundBlockList *RenderMusic,cSoundBlockList *ToEncodeMusic,bool &Continue); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ engine/_EncodeVideo.cpp:930:117: error: binding reference of type ‘bool&’ to ‘const bool’ discards qualifiers 930 | ThreadAssembly.setFuture(QtConcurrent::run([=]{Assembly(Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)})); | ^~~~~~~~ engine/_EncodeVideo.h:126:160: note: initializing argument 5 of ‘void cEncodeVideo::Assembly(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&)’ 126 | void Assembly(cDiaporamaObjectInfo *Frame,cDiaporamaObjectInfo *PreviousFrame,cSoundBlockList *RenderMusic,cSoundBlockList *ToEncodeMusic,bool &Continue); | ~~~~~~^~~~~~~~ engine/_EncodeVideo.cpp: In member function ‘bool cEncodeVideo::DoEncode()’: engine/_EncodeVideo.cpp:930:56: error: use of deleted function ‘cSoundBlockList::cSoundBlockList(const cSoundBlockList&)’ 930 | ThreadAssembly.setFuture(QtConcurrent::run([=]{Assembly(Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)})); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
If I use
ThreadAssembly.setFuture(QtConcurrent::run([=]{Assembly(Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)}));
as solution corresponding to link text
I getengine/_EncodeVideo.cpp: In lambda function: engine/_EncodeVideo.cpp:930:89: error: invalid conversion from ‘const cSoundBlockList*’ to ‘cSoundBlockList*’ [-fpermissive] 930 | ThreadAssembly.setFuture(QtConcurrent::run([=]{Assembly(Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)})); | ^~~~~~~~~~~~ | | | const cSoundBlockList* engine/_EncodeVideo.h:126:111: note: initializing argument 3 of ‘void cEncodeVideo::Assembly(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&)’ 126 | void Assembly(cDiaporamaObjectInfo *Frame,cDiaporamaObjectInfo *PreviousFrame,cSoundBlockList *RenderMusic,cSoundBlockList *ToEncodeMusic,bool &Continue); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~ engine/_EncodeVideo.cpp:930:102: error: invalid conversion from ‘const cSoundBlockList*’ to ‘cSoundBlockList*’ [-fpermissive] 930 | ThreadAssembly.setFuture(QtConcurrent::run([=]{Assembly(Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)})); | ^~~~~~~~~~~~~~ | | | const cSoundBlockList* engine/_EncodeVideo.h:126:140: note: initializing argument 4 of ‘void cEncodeVideo::Assembly(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&)’ 126 | void Assembly(cDiaporamaObjectInfo *Frame,cDiaporamaObjectInfo *PreviousFrame,cSoundBlockList *RenderMusic,cSoundBlockList *ToEncodeMusic,bool &Continue); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ engine/_EncodeVideo.cpp:930:117: error: binding reference of type ‘bool&’ to ‘const bool’ discards qualifiers 930 | ThreadAssembly.setFuture(QtConcurrent::run([=]{Assembly(Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)})); | ^~~~~~~~ engine/_EncodeVideo.h:126:160: note: initializing argument 5 of ‘void cEncodeVideo::Assembly(cDiaporamaObjectInfo*, cDiaporamaObjectInfo*, cSoundBlockList*, cSoundBlockList*, bool&)’ 126 | void Assembly(cDiaporamaObjectInfo *Frame,cDiaporamaObjectInfo *PreviousFrame,cSoundBlockList *RenderMusic,cSoundBlockList *ToEncodeMusic,bool &Continue); | ~~~~~~^~~~~~~~ engine/_EncodeVideo.cpp: In member function ‘bool cEncodeVideo::DoEncode()’: engine/_EncodeVideo.cpp:930:56: error: use of deleted function ‘cSoundBlockList::cSoundBlockList(const cSoundBlockList&)’ 930 | ThreadAssembly.setFuture(QtConcurrent::run([=]{Assembly(Frame,PreviousFrame,&RenderMusic,&ToEncodeMusic,Continue)})); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@mpvx
Here is what I would recommend you to do:- Create a static dummy function without parameters
- Test whether calling QtConcurrent::run with that dummy function works
- Create a member dummy function without parameters
- Test whether you can call them
- One by one, start adding your parameters to the dummy function. It does not need to do anything with them, just accept them
- Find out at which point the code no longer compiles
If, at that point, you cannot figure out what exactly the problem is, post
- your dummy function
- the code that calls the dummy function
-
It looks like Qt6’s QtConcurrent::run no longer supports passing a raw pointer to a member function the way Qt5 did. You’ll need to use a lambda or std::bind to wrap the member function call. For example:
ThreadAssembly.setFuture(QtConcurrent::run(= {
this->Assembly(Frame, PreviousFrame, &RenderMusic, &ToEncodeMusic, Continue);
}));
This way, the function becomes a callable object compatible with Qt6’s QtConcurrent::run. It should fix the operator() / ArgResolver errors you’re seeing.