Actually writes No such slot

void runA(long &a, long &b, int end); 

I want to call it recursively like this

 QTimer::singleShot(300, this, SLOT(runA(a,b,end))); 

Before that I used no problems in the projects. I checked Q_OBJECT in place, tried to move the slot to the public stlot does not help as in public Q_OBJECT.

    1 answer 1

    QTimer::singleShot accepts only slots with no arguments, otherwise it simply has nowhere to get them. Use lambda or signal slots. The correct syntax for SLOT is SLOT(runA(long, long, int)) , but in this case it will not work.

    One solution:

     QTimer::singleShot(300, this, [=]{ this->runA(a,b,end); }); 
    • long thought about it, but it seems you are right - AR Hovsepyan