+
+ newHoveredWidget->setExpansionAreaHovered(true);
+ } else {
+ // make sure we unhover the old one first if old!=new
+ auto oldHoveredWidget = hoveredWidget();
+ if (oldHoveredWidget && oldHoveredWidget != newHoveredWidget) {
+ oldHoveredWidget->setHovered(false);
+ Q_EMIT itemUnhovered(oldHoveredWidget->index());
+ }
+ // we also unhover any old expansion toggle hovers, in case the mouse movement from expansion toggle to icon+text is too fast (i.e. newHoveredWidget is never null between the transition)
+ unhoverOldExpansionWidget();
+
+ const bool isOverIconAndText = newHoveredWidget->iconRect().contains(mappedPos) || newHoveredWidget->textRect().contains(mappedPos);
+ const bool hasMultipleSelection = m_selectionManager->selectedItems().count() > 1;
+
+ if (hasMultipleSelection && !isOverIconAndText) {
+ // In case we have multiple selections, clicking on any row will deselect the selection.
+ // So, as a visual cue for signalling that clicking anywhere won't select, but clear current highlights,
+ // we disable hover of the *row*(i.e. blank space to the right of the icon+text)
+
+ // (no-op in this branch for masked hover)
+ } else {
+ newHoveredWidget->setHoverPosition(mappedPos);
+ if (oldHoveredWidget != newHoveredWidget) {
+ newHoveredWidget->setHovered(true);
+ Q_EMIT itemHovered(newHoveredWidget->index());
+ }
+ }
+ }
+ } else {
+ // unhover any currently hovered expansion and text+icon widgets
+ unhoverOldHoveredWidget();
+ unhoverOldExpansionWidget();
+ }