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. --- spline/spline-widget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spline') diff --git a/spline/spline-widget.cpp b/spline/spline-widget.cpp index c7dd5e5a..1a39cc23 100644 --- a/spline/spline-widget.cpp +++ b/spline/spline-widget.cpp @@ -379,7 +379,7 @@ void spline_widget::mousePressEvent(QMouseEvent *e) } } _draw_function = true; - update(); + repaint(); } void spline_widget::mouseMoveEvent(QMouseEvent *e) @@ -433,7 +433,7 @@ void spline_widget::mouseMoveEvent(QMouseEvent *e) setCursor(Qt::ClosedHandCursor); show_tooltip(pix, new_pt); - update(); + repaint(); } else if (sz) { @@ -480,7 +480,7 @@ void spline_widget::mouseReleaseEvent(QMouseEvent *e) else QToolTip::hideText(); - update(); + repaint(); } } @@ -551,7 +551,7 @@ void spline_widget::update_range() _background = QPixmap(); _function = QPixmap(); - update(); + repaint(); } bool spline_widget::point_within_pixel(const QPointF& pt, const QPoint &pixel) -- cgit v1.2.3