From 35978072c44f5ec84417da43904e7dad879fc5a4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 17 Apr 2017 16:38:22 +0200 Subject: 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. --- cv/video-widget.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cv') 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 -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(); } } -- cgit v1.2.3