#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();
}