+ };
+
+ const QPointF pos = transform.map(event->pos());
+ if (KItemListWidget *newHoveredWidget = widgetForPos(pos); newHoveredWidget) {
+ // something got hovered, work out which part and set hover for the appropriate widget
+ const auto mappedPos = newHoveredWidget->mapFromItem(m_view, pos);
+ const bool isOnExpansionToggle = newHoveredWidget->expansionToggleRect().contains(mappedPos);
+
+ if (isOnExpansionToggle) {
+ // make sure we unhover the old one first if old!=new
+ if (oldHoveredExpansionWidget && *oldHoveredExpansionWidget != newHoveredWidget) {
+ (*oldHoveredExpansionWidget)->setExpansionAreaHovered(false);
+ }
+ // we also unhover any old icon+text hovers, in case the mouse movement from icon+text to expansion toggle is too fast (i.e. newHoveredWidget is never null between the transition)
+ unhoverOldHoveredWidget();
+
+ 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->selectionRectCore().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)