summaryrefslogtreecommitdiffhomepage
path: root/spline/spline-widget.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 /spline/spline-widget.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 'spline/spline-widget.cpp')
-rw-r--r--spline/spline-widget.cpp8
1 files changed, 4 insertions, 4 deletions
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)