QTimer::start(std::chrono::duration -> int)

The chrono::duration-friendly method is availble from Qt 5.8 only.
This commit is contained in:
Sergiusz Bazanski 2018-07-21 21:44:40 +01:00
parent 9e6deed3b8
commit 44f52234fb
2 changed files with 3 additions and 3 deletions

View File

@ -277,11 +277,11 @@ FPGAViewWidget::FPGAViewWidget(QWidget *parent)
} }
connect(&paintTimer_, SIGNAL(timeout()), this, SLOT(update())); connect(&paintTimer_, SIGNAL(timeout()), this, SLOT(update()));
paintTimer_.start(std::chrono::duration<int, std::milli>(1000 / 20)); // paint GL 20 times per second paintTimer_.start(1000 / 20); // paint GL 20 times per second
renderRunner_ = std::unique_ptr<PeriodicRunner>(new PeriodicRunner(this, [this] { renderLines(); })); renderRunner_ = std::unique_ptr<PeriodicRunner>(new PeriodicRunner(this, [this] { renderLines(); }));
renderRunner_->start(); renderRunner_->start();
renderRunner_->startTimer(std::chrono::duration<int, std::milli>(1000 / 2)); // render line 2 times per second renderRunner_->startTimer(1000 / 2); // render lines 2 times per second
} }
FPGAViewWidget::~FPGAViewWidget() {} FPGAViewWidget::~FPGAViewWidget() {}

View File

@ -244,7 +244,7 @@ class PeriodicRunner : public QThread
} }
} }
void startTimer(std::chrono::milliseconds value) { timer_.start(value); } void startTimer(int msecs) { timer_.start(msecs); }
~PeriodicRunner() ~PeriodicRunner()
{ {