Commit 29383426 authored by George Florea Bănuș's avatar George Florea Bănuș Committed by Felix Ernst
Browse files

Fix tooltip closing while mouse moves over item

The itemHovered signal is emitted whenever the mouses moves causing the
tooltip to close.
parent 1041b52c
Pipeline #157866 passed with stage
in 2 minutes and 27 seconds
......@@ -871,7 +871,8 @@ bool KItemListController::hoverMoveEvent(QGraphicsSceneHoverEvent* event, const
newHoveredWidget->setExpansionAreaHovered(true);
} else {
// make sure we unhover the old one first if old!=new
if (auto oldHoveredWidget = hoveredWidget(); oldHoveredWidget && oldHoveredWidget != newHoveredWidget) {
auto oldHoveredWidget = hoveredWidget();
if (oldHoveredWidget && oldHoveredWidget != newHoveredWidget) {
oldHoveredWidget->setHovered(false);
Q_EMIT itemUnhovered(oldHoveredWidget->index());
}
......@@ -888,9 +889,11 @@ bool KItemListController::hoverMoveEvent(QGraphicsSceneHoverEvent* event, const
// (no-op in this branch for masked hover)
} else {
newHoveredWidget->setHovered(true);
newHoveredWidget->setHoverPosition(mappedPos);
Q_EMIT itemHovered(newHoveredWidget->index());
if (oldHoveredWidget != newHoveredWidget) {
newHoveredWidget->setHovered(true);
Q_EMIT itemHovered(newHoveredWidget->index());
}
}
}
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment