summaryrefslogtreecommitdiffhomepage
path: root/gui/main-window.cpp
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 /gui/main-window.cpp
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 'gui/main-window.cpp')
-rw-r--r--gui/main-window.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/gui/main-window.cpp b/gui/main-window.cpp
index fb036721..1fdfcb53 100644
--- a/gui/main-window.cpp
+++ b/gui/main-window.cpp
@@ -86,7 +86,7 @@ MainWindow::MainWindow() :
// timers
connect(&config_list_timer, &QTimer::timeout, this, [this]() { refresh_config_list(); });
- connect(&pose_update_timer, SIGNAL(timeout()), this, SLOT(showHeadPose()));
+ connect(&pose_update_timer, SIGNAL(timeout()), this, SLOT(showHeadPose()), Qt::DirectConnection);
connect(&det_timer, SIGNAL(timeout()), this, SLOT(maybe_start_profile_from_executable()));
// ctrl+q exits
@@ -515,8 +515,8 @@ void MainWindow::display_pose(const double *mapped, const double *raw)
ui.pose_display->rotate_async(mapped[Yaw], mapped[Pitch], -mapped[Roll],
mapped[TX], mapped[TY], mapped[TZ]);
- if (mapping_widget)
- mapping_widget->update();
+ if (mapping_widget && mapping_widget->isVisible())
+ mapping_widget->repaint();
QLCDNumber* raw_[] = {
ui.raw_x, ui.raw_y, ui.raw_z,