From b0ee466c323fe5a21aec373967200af9e389cd67 Mon Sep 17 00:00:00 2001 From: Gitea Date: Fri, 30 Aug 2019 12:43:25 +0200 Subject: [PATCH] Introduces public methods for starting and stopping the display refresh timer to osciwidget --- osciwidget.cpp | 8 +++++++- osciwidget.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osciwidget.cpp b/osciwidget.cpp index 94e2ea5..3e7c07d 100644 --- a/osciwidget.cpp +++ b/osciwidget.cpp @@ -132,15 +132,21 @@ void OsciWidget::resizeEvent(QResizeEvent *event) resizePixmap(); } -void OsciWidget::restartTimer() +void OsciWidget::stop() { if (m_timerId != -1) killTimer(m_timerId); +} +void OsciWidget::start() +{ m_timerId = startTimer(1000/m_framerate); } +void OsciWidget::restartTimer() { + stop(); + start(); } void OsciWidget::resizePixmap() diff --git a/osciwidget.h b/osciwidget.h index 2d54d26..98740d7 100644 --- a/osciwidget.h +++ b/osciwidget.h @@ -22,6 +22,8 @@ public: int framerate() const; int blend() const; float factor() const; + void start(); + void stop(); public slots: void setFramerate(int framerate);