I have the following situation:
I have to repaint the screen every few minutes so that objects on the screen get stuck on account, but this has to happen in a way that the program will not crash.
I have tried to make a Thread and call the update method but the screen turns white, all locked.
Basically, I need this to occur at a specific time, but not to influence the program's subsequent processes (such as keyboard and mouse events).
void atualizar(){
X = X - 20;
repaint();
}
I think the best thing is with Thread, but I could not implement it correctly, even following the official QT documentation.
Another point, when trying to do with Thread the painting event ends up being called twice, occurring in crash in the program.