From 1e2c943ae903ac1187bcc280632b8f49a4f1c86e Mon Sep 17 00:00:00 2001 From: kornes <28986062+kornes@users.noreply.github.com> Date: Sun, 25 Feb 2024 12:19:50 +0000 Subject: [PATCH] perf: prevent unnecessary layouts at leaveEvent (#4879) --- src/widgets/helper/ChannelView.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index a66059bb8..6b293235f 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -520,10 +520,10 @@ void ChannelView::pause(PauseReason reason, std::optional msecs) void ChannelView::unpause(PauseReason reason) { - /// Remove the value from the map - this->pauses_.erase(reason); - - this->updatePauses(); + if (this->pauses_.erase(reason) > 0) + { + this->updatePauses(); + } } void ChannelView::updatePauses() @@ -1761,8 +1761,6 @@ void ChannelView::leaveEvent(QEvent * /*event*/) this->tooltipWidget_->hide(); this->unpause(PauseReason::Mouse); - - this->queueLayout(); } void ChannelView::mouseMoveEvent(QMouseEvent *event)