In my QRunnable-derived class I need to "sleep" until external database operation is completed. How can I do that? QThread::sleep is protected static...
Thanks.
In my QRunnable-derived class I need to "sleep" until external database operation is completed. How can I do that? QThread::sleep is protected static...
Thanks.
Strange, I can't find this global function in Qt docs or in QThread class. Can you post the link to the doc or let me know where to look for ::sleep()?
It's not a Qt function. It's a POSIX.1-2001 function. I'm sure Windows has its own equivalent if it doesn't support it directly.
TorAn (19th November 2009)
I am surprised the there is no qt-way of doing it in platform-independent manner.
Will this hack work?
Qt Code:
{ public: static void mysleep(int ms) { return sleep(ms); } };To copy to clipboard, switch view to plain text mode
Considering QThread::sleep() calls ::Sleep, I'd have to say yes.
Bookmarks