java timer task schedule

This works. The key is to have the task itself (after it completes) schedule the next occurrence of the task. import java.util.Timer; import java.util.TimerTask; public class TaskManager { private Timer timer = new Timer(); public static void main(String[] args) { TaskManager manager = new TaskManager(); manager.startTask(); } public void startTask() { timer.schedule(new PeriodicTask(), 0); } … Read more

Starting QTimer In A QThread

As I commented (further information in the link) you are doing it wrong : You are mixing the object holding thread data with another object (responsible of doIt()). They should be separated. There is no need to subclass QThread in your case. Worse, you are overriding the run method without any consideration of what it … Read more