Important: Please read the Qt Code of Conduct -

[SOLVED] QtConcurrent::run function call missing argument list

  • Hi ,
    i have a class Signatures , inside it i have two functions , both are private slots :

    • void Signatures::on_install_clear_clicked()
    • void Signatures::parse_clear_file(EHT_wrapper<App>* apps,QString path)

    and i have a signal part :
    void line_read(int);

    from on_install_clear_clicked i call to parse_clear_file using :

    void Signatures::on_install_clear_clicked(){
    QFuture<void> future = QtConcurrent::run(this->parse_clear_file,this->app,this->clear_path);

    both app and clear_path are private members of Signatures class
    the function parse_clear_file also emits a signal line_read(int) in the Signatures class .

    when i compile the above i get like 42 errors they start like :
    signatures.cpp:403: error: C3867: 'Signatures::parse_clear_file': function call missing argument list; use '&Signatures::parse_clear_file' to create a pointer to member
    signatures.cpp:403: error: C2039: 'app' : is not a member of 'Signatures'
    signatures.cpp:403: error: C2780: 'QFuture<T> QtConcurrent::run(const Class ,T (__thiscall Class:: )(Param1,Param2,Param3,Param4,Param5) const,const Arg1 &,const Arg2 &,const Arg3 &,const Arg4 &,const Arg5 &)' : expects 7 arguments - 2 provided

  • Moderators

    Should be something more like this:

    QFuture<void> future = QtConcurrent::run(this, &Signatures::parse_clear_file, app, clear_path);

  • Yes thanks that worked .

Log in to reply