From 3c124f9f2776928c0866071d1a99f83101cddde1 Mon Sep 17 00:00:00 2001 From: Syping Date: Mon, 24 Aug 2020 17:23:10 +0200 Subject: [PATCH] improve hover detection performance --- ProfileInterface.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index 4e526fa..92a144c 100644 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -1862,13 +1862,17 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event) void ProfileInterface::hoverProfileWidgetCheck() { ProfileWidget *pWidget = nullptr; - for (ProfileWidget *widget : widgets.keys()) + QMap::const_iterator it = widgets.constBegin(); + QMap::const_iterator end = widgets.constEnd(); + while (it != end) { + ProfileWidget *widget = it.key(); if (widget->underMouse()) { pWidget = widget; break; } + it++; } if (pWidget != nullptr) {