Hi everybody,
how could i wait 2 seconds one my code before i continue?
I know that with QTimer its possible, but i need a example..
Can somebody send me a example? :o
Printable View
Hi everybody,
how could i wait 2 seconds one my code before i continue?
I know that with QTimer its possible, but i need a example..
Can somebody send me a example? :o
1. Create QTimer
2. connect QTimer's signal (timeout) to your slot
3. start it
Code:
timer->setSingleShot(true); connect(timer, SIGNAL(timeout()), this, SLOT(yourSlot())); timer->start(2000); ... void yourClass::yourSlot() { }
or maybe you just want to do sleep(2). I don't the reasons why you need to wait.
Thanks it works!!!
:D
Btw, QTimer has a convenient static method which can combine all that to a single statement: