spacr.qt.widgets.hover_tooltip
==============================

.. py:module:: spacr.qt.widgets.hover_tooltip

.. autoapi-nested-parse::

   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
---------------

.. py:class:: HoverTooltip

   Bases: :py:obj:`PySide6.QtWidgets.QFrame`


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

   Access via :meth:`instance` — the popup is a process-wide singleton.


   .. py:method:: instance() -> HoverTooltip
      :classmethod:


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



   .. py:method:: show_for(anchor: PySide6.QtWidgets.QWidget, html: str) -> None

      Show the tooltip beneath ``anchor`` with body ``html``.

      :param anchor: widget the popup docks to (clamped to its screen).
      :param html: rich-text body; empty strings are ignored.



   .. py:method:: start_hide(delay_ms: int = 250) -> None

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



   .. py:method:: cancel_hide() -> None

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



   .. py:method:: enterEvent(event)

      Cancel the hide timer when the cursor enters the popup.



   .. py:method:: leaveEvent(event)

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



