edifice.use_hover#
- edifice.use_hover()[source]#
Hook to track mouse hovering.
Use this hook to track if the mouse is hovering over a
QtWidgetElement.- Returns:
boolTrue if the mouse is hovering over the
QtWidgetElement, False otherwise.
Callable[[QtGui.QMouseEvent], None]Pass this function to the
on_mouse_enterprop of theQtWidgetElement
Callable[[QtGui.QMouseEvent], None]Pass this function to the
on_mouse_leaveprop of theQtWidgetElement.
- Return type:
A tuple of three values
use_hover#hover, on_mouse_enter, on_mouse_leave = use_hover() with VBoxView( on_mouse_enter=on_mouse_enter, on_mouse_leave=on_mouse_leave, style={"background-color": "green"} if hover else {}, ): if hover: Label(text="hovering")
The
on_mouse_enterandon_mouse_leavefunctions can be passed to more than oneQtWidgetElement.