From e66b3792bb96e4f7445ce9503d3a6fd9690e5fa2 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 21 Jan 2022 17:02:08 -0500 Subject: [PATCH] Add overlay relay signals and attr to our `ChartView` --- piker/ui/_interaction.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/piker/ui/_interaction.py b/piker/ui/_interaction.py index 6fba5070..8cd8cf98 100644 --- a/piker/ui/_interaction.py +++ b/piker/ui/_interaction.py @@ -333,6 +333,16 @@ class ChartView(ViewBox): ''' mode_name: str = 'view' + # "relay events" for making overlaid views work. + # NOTE: these MUST be defined here (and can't be monkey patched + # on later) due to signal construction requiring refs to be + # in place during the run of meta-class machinery. + mouseDragEventRelay = QtCore.Signal(object, object, object) + wheelEventRelay = QtCore.Signal(object, object, object) + + event_relay_source: 'Optional[ViewBox]' = None + relays: dict[str, Signal] = {} + def __init__( self,