I’m playing around with Qt, and I want to create a simple pause between two commands. However it won’t seem to let me use Sleep(int mili);, and I can’t find any obvious wait functions.
I am basically just making a console application to test some class code which will later be included in a proper Qt GUI, so for now I’m not bothered about breaking the whole event-driven model.
This previous question mentions using
qSleep()which is in theQtTestmodule. To avoid the overhead linking in theQtTestmodule, looking at the source for that function you could just make your own copy and call it. It uses defines to call either WindowsSleep()or Linuxnanosleep().