Вот как я обошёл проблему защиты функций QThread sleep
:
// QThread has static sleep functions; but they're protected (duh).
// So we provide wrapper functions:
//
// void MyLib::sleep (unsigned long secs)
// void MyLib::msleep (unsigned long msecs)
// void MyLib::usleep (unsigned long usecs)
#include <QThread>
namespace MyLib
{
class DerivedFromQThread : protected QThread
{
public:
static void sleep (unsigned long secs) { QThread::sleep (secs) ; }
static void msleep (unsigned long msecs) { QThread::msleep (msecs) ; }
static void usleep (unsigned long usecs) { QThread::usleep (usecs) ; }
} ;
void sleep (unsigned long secs) { DerivedFromQThread::sleep (secs) ; }
void msleep (unsigned long msecs) { DerivedFromQThread::msleep (msecs) ; }
void usleep (unsigned long usecs) { DerivedFromQThread::usleep (usecs) ; }
} // namespace MyLib