spacr.qt.widgets.hover_tooltip

HoverTooltip — a QFrame-based popup that stays visible when the mouse enters it. Unlike QToolTip, users can move their cursor into the popup to click links inside.

Usage:

tip = HoverTooltip.instance() tip.show_for(some_widget, “some html”) # on hover-enter tip.start_hide() # on hover-leave

The popup cancels its own hide timer if the mouse enters it, and only actually hides when neither the anchor nor the popup itself is under the cursor.

Module Contents

class spacr.qt.widgets.hover_tooltip.HoverTooltip[source]

Bases: PySide6.QtWidgets.QFrame

Sticky QFrame popup that survives cursor entry so users can click links.

Access via instance() — the popup is a process-wide singleton.

classmethod instance() HoverTooltip[source]

Return the process-wide singleton, creating it on first access.

show_for(anchor: PySide6.QtWidgets.QWidget, html: str) None[source]

Show the tooltip beneath anchor with body html.

Parameters:
  • anchor – widget the popup docks to (clamped to its screen).

  • html – rich-text body; empty strings are ignored.

start_hide(delay_ms: int = 250) None[source]

Schedule a hide after delay_ms unless the cursor re-enters.

cancel_hide() None[source]

Cancel any pending hide timer (called on cursor re-entry).

enterEvent(event)[source]

Cancel the hide timer when the cursor enters the popup.

leaveEvent(event)[source]

Restart the hide timer with a short delay when the cursor leaves.