#include <iostream>
#include <QProcess>
-#include <QTime>
+#include <QElapsedTimer>
#include <QThread>
#include <QCoreApplication>
#include <QDebug>
while (!timedout) {
if (process_->waitForFinished(timeout))
return true;
- bool stop = queryStopCommand(cmd_);
+ bool const stop = queryStopCommand(cmd_);
// The command may have finished in the meantime
if (process_->state() == QProcess::NotRunning)
return true;
}
// process events while waiting with timeout
- QTime timer;
+ QElapsedTimer timer;
timer.start();
while (state == waitwhile && state != Error && !timedout) {
// check for cancellation of background process
return false;
if (timer.elapsed() > timeout) {
- bool stop = queryStopCommand(cmd_);
+ bool const stop = queryStopCommand(cmd_);
// The command may have finished in the meantime
if (process_->state() == QProcess::NotRunning)
break;