Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtConcurrent::run errors with Qt6
Forum Update on Monday, May 27th 2025

QtConcurrent::run errors with Qt6

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 161 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mpvx
    wrote on 11 Feb 2025, 18:34 last edited by
    #1

    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)...);
          |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 11 Feb 2025, 19:54 last edited by SGaist 2 Nov 2025, 19:54
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      1/2

      11 Feb 2025, 18:34

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved