QtConcurrent::run errors with Qt6
Unsolved
General and Desktop
-
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.