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?![]()
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?![]()
Think DigitalGasoline
1. Create QTimer
2. connect QTimer's signal (timeout) to your slot
3. start it
Qt Code:
timer->setSingleShot(true); connect(timer, SIGNAL(timeout()), this, SLOT(yourSlot())); timer->start(2000); ... void yourClass::yourSlot() { }To copy to clipboard, switch view to plain text mode
or maybe you just want to do sleep(2). I don't the reasons why you need to wait.
I'm a rebel in the S.D.G.
Thanks it works!!!
![]()
Think DigitalGasoline
Btw, QTimer has a convenient static method which can combine all that to a single statement:
Qt Code:
To copy to clipboard, switch view to plain text mode
J-P Nurmi
Bookmarks