Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
It is necessary to make the class declaration in the *.h file, and the implementation in *.cpp.
#include <QCoreApplication>
#include <QDebug>
#include <QTimer>
void foo()
{
qDebug() << "Bingo";
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QTimer timer;
QObject::connect(&timer, &QTimer::timeout, std::bind(foo));
timer.start(1000);
return a.exec();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question