diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-17 16:38:22 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-17 16:38:22 +0200 |
commit | 35978072c44f5ec84417da43904e7dad879fc5a4 (patch) | |
tree | d5c98f64eb19796d802d53cd4820bb2b4d17d246 /cv | |
parent | 5b286bc5595196637d60e63ffea106ce73c1aa7c (diff) |
few widgets: use repaint() for no event loop overhead
The Qt event loop overhead formed a decent amount of total CPU
usage. `repaint()' is a direct call.
Diffstat (limited to 'cv')
-rw-r--r-- | cv/video-widget.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cv/video-widget.cpp b/cv/video-widget.cpp index e688732c..f4c16776 100644 --- a/cv/video-widget.cpp +++ b/cv/video-widget.cpp @@ -9,8 +9,9 @@ #include "video-widget.hpp" #include <opencv2/imgproc.hpp> -cv_video_widget::cv_video_widget(QWidget* parent) : - QWidget(parent), freshp(false) +cv_video_widget::cv_video_widget(QWidget* parent) : QWidget(parent), + mtx(QMutex::Recursive), + freshp(false) { connect(&timer, SIGNAL(timeout()), this, SLOT(update_and_repaint()), Qt::DirectConnection); timer.start(65); @@ -73,6 +74,6 @@ void cv_video_widget::update_and_repaint() if (freshp) { freshp = false; - update(); + repaint(); } } |