|
|
@ -41,6 +41,7 @@ |
|
|
|
#include <QProcess> |
|
|
|
#include <QProcess> |
|
|
|
#include <QSettings> |
|
|
|
#include <QSettings> |
|
|
|
#include <QLocale> |
|
|
|
#include <QLocale> |
|
|
|
|
|
|
|
#include <QThread> |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DISABLE_GUI |
|
|
|
#ifdef DISABLE_GUI |
|
|
|
#include <QCoreApplication> |
|
|
|
#include <QCoreApplication> |
|
|
@ -631,3 +632,18 @@ QString misc::accurateDoubleToString(const double &n, const int &precision, bool |
|
|
|
else |
|
|
|
else |
|
|
|
return QString::number(std::floor(n*prec)/prec, 'f', precision); |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|