I am visualizing an incremental algorithm and at each step in the algorithm I want to update the GUI, pause for a couple of seconds, then continue on to the next step of the algorithm (and repeat).
What is the prefered method of doing this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The right way to do this is to use a QTimer (either instantiate a QTimer object and call start() on it, or just call QTimer::singleShot()). Update your GUI in the slot connected to the QTimer’s timeout() signal.