mix IDE M2

Integrated debugger;
Hit F5 and you can step forwards/backwards through execution.

keyPressed is performed in the foreground.
QThread::sleep(10);
blocks the user interface