Remove inclusion of <QThread> from misc.h

This commit is contained in:
Ivan Sorokin 2014-10-18 03:29:12 +04:00
parent be338b969c
commit 5ea1a4c3cc
3 changed files with 19 additions and 11 deletions

View file

@ -41,6 +41,7 @@
#include <QProcess>
#include <QSettings>
#include <QLocale>
#include <QThread>
#ifdef DISABLE_GUI
#include <QCoreApplication>
@ -631,3 +632,18 @@ QString misc::accurateDoubleToString(const double &n, const int &precision, bool
else
return QString::number(std::floor(n*prec)/prec, 'f', precision);
}
namespace {
// Trick to get a portable sleep() function
class SleeperThread : public QThread {
public:
static void msleep(unsigned long msecs)
{
QThread::msleep(msecs);
}
};
}
void misc::msleep(unsigned long msecs) {
SleeperThread::msleep(msecs);
}