summaryrefslogtreecommitdiffhomepage
path: root/cv
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-04-17 16:38:22 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-04-17 16:38:22 +0200
commit35978072c44f5ec84417da43904e7dad879fc5a4 (patch)
treed5c98f64eb19796d802d53cd4820bb2b4d17d246 /cv
parent5b286bc5595196637d60e63ffea106ce73c1aa7c (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.cpp7
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();
}
}