improve hover detection performance
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Syping 2020-08-24 17:23:10 +02:00
parent 27075778c6
commit 3c124f9f27

View file

@ -1862,13 +1862,17 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
void ProfileInterface::hoverProfileWidgetCheck() void ProfileInterface::hoverProfileWidgetCheck()
{ {
ProfileWidget *pWidget = nullptr; ProfileWidget *pWidget = nullptr;
for (ProfileWidget *widget : widgets.keys()) QMap<ProfileWidget*, QString>::const_iterator it = widgets.constBegin();
QMap<ProfileWidget*, QString>::const_iterator end = widgets.constEnd();
while (it != end)
{ {
ProfileWidget *widget = it.key();
if (widget->underMouse()) if (widget->underMouse())
{ {
pWidget = widget; pWidget = widget;
break; break;
} }
it++;
} }
if (pWidget != nullptr) if (pWidget != nullptr)
{ {