Hello,
I think You can improve your run() function in the following way:
Qt Code:
void Logger::run() { QTimer timer; timer.setInterval(updateIntervalSeconds*1000); connect(&timer, SIGNAL(timeout()), this, SLOT(doJob())); timer.start(); exec(); }To copy to clipboard, switch view to plain text mode
I think it is better to create QTimer object on the stack. This object will be destroyed automatically when the run() function finishes. When You call exec() - evet loop is started at this point.
Br,
Poter




Reply With Quote


Bookmarks