PDA

View Full Version : QTimer



Ahmad
22nd October 2007, 18:11
Hi Everyone
i have an application , in which i want to execute a certain number of instructions and then force a 3 second delai before executing the next instruction(cause i want to show some graphic animation, objects changing color)...
i have used a QTimer like this:

emit color(indice_inf, indice_sup); //i want to execute this line before the timer begins
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(affiche()));
timer->start(3000);
echange(tab, indice_inf, indice_sup);// i want to execute this line after 3 s of delai

but my problem is that it executes the instructions of affiche() function after a periodic delai of 3s (as i assume it should do) but it executes all the rest of the instructions of my application as well... so i want to force some kind of delai between the execution of two instructions..... can anyone help me, hope u ve understand my probleme....... tnx a lot

wysota
22nd October 2007, 18:26
You can for example move the rest of "instructions" after the timer to a slot that gets executed when the timer fires. They will be executed then.