I am using Qt5 under Windows7.
I know how to create a task using QThread, but my problem is:
How do I run it every day at 03:00AM?
I was thinking about QTimer, but it doesn't seem to be ok... it can't be linked somehow to 03:00am.
Just to make it clear: I can't use some Windows application(s). It must be coded inside my Qt app as it does some cleaning job too: cleanup history list, trim it down to 1000 lines (or whatever), etc. So, you see I can't do that using TaskScheduler or similar Windows tools...
Whats wrong with using a
QTimer
? I agree that a task scheduler is the better option. Here, only about0,03%
of the time code is executed it is really supposed to do something. If the exact moment is not as important you can increase the timer interval and the check-boundaries and reduce the unncessary calls. But if you prefer such a solution this should work: