Problem:
I have a function void myFunc(data)
I am reading data from database using QSqlQuery:
QSqlQuery qry;
if (qry.exec("SELECT data, interval from table"))
{
while(qry.next())
{
// Somehow create and call function: myFunc(int data) periodically with interval = interval
}
}
As far as I understand I could use a timer like that:
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(myFunc()));
timer->start(interval); //time specified in ms
but how can I pass argument data
to myFunc
when I create this timer?