Add delay routine to MainWindow to allow sleep in a Qt friendly way #4823

This commit is contained in:
Adam Potolsky 2015-06-23 17:10:49 -07:00
parent 267f3ac41f
commit 19f5ad8cab
2 changed files with 11 additions and 0 deletions

View File

@ -1351,3 +1351,12 @@ QString MainWindow::getProfileRootForArg()
return QString("\"%1\"").arg(dir); return QString("\"%1\"").arg(dir);
} }
void MainWindow::delay(unsigned int s)
{
QTime dieTime= QTime::currentTime().addSecs(s);
while( QTime::currentTime() < dieTime ) {
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}
}

View File

@ -63,6 +63,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
friend class QSynergyApplication; friend class QSynergyApplication;
friend class SetupWizard; friend class SetupWizard;
friend class PluginWizardPage;
public: public:
enum qSynergyState enum qSynergyState
@ -108,6 +109,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void serverDetected(const QString name); void serverDetected(const QString name);
void setEdition(int type); void setEdition(int type);
void updateLocalFingerprint(); void updateLocalFingerprint();
void delay(unsigned int);
public slots: public slots:
void appendLogRaw(const QString& text); void appendLogRaw(const QString& text);