1. Create QTimer
2. connect QTimer's signal (timeout) to your slot
3. start it
timer->setSingleShot(true);
connect(timer, SIGNAL(timeout()), this, SLOT(yourSlot()));
timer->start(2000);
...
void yourClass::yourSlot()
{
}
QTimer *timer = new QTimer;
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.
Bookmarks