def __init__(self, canvas, num):
    'Ctor for the LeoFigureManagerQt class.'
    self.c = c = g.app.log.c
    super().__init__(canvas, num)
    self.canvas = canvas
    self.vr_controller = vc = vr.controllers.get(c.hash())
    self.splitter = c.free_layout.get_top_splitter()
    self.frame = w = QtWidgets.QFrame()
    w.setLayout(QtWidgets.QVBoxLayout())
    w.layout().addWidget(self.canvas)
    if vc:
        vc.embed_widget(w)

    class DummyWindow():

        def __init__(self, c):
            self.c = c
            self._destroying = None

        def windowTitle(self):
            return self.c.p.h
    self.window = DummyWindow(c)
    FocusPolicy = (QtCore.Qt.FocusPolicy if isQt6 else QtCore.Qt)
    self.canvas.setFocusPolicy(FocusPolicy.StrongFocus)
    self.canvas.setFocus()
    self.canvas._destroying = False
    self.toolbar = self._get_toolbar(self.canvas, self.frame)
    if (self.toolbar is not None):
        layout = self.frame.layout()
        layout.addWidget(self.toolbar)
        self.statusbar_label = QtWidgets.QLabel()
        layout.addWidget(self.statusbar_label)
        if (isQt5 or isQt6):
            pass
        else:
            self.toolbar.message.connect(self._show_message)
    self.canvas.draw_idle()

    def notify_axes_change(fig):
        if (self.toolbar is not None):
            self.toolbar.update()
    self.canvas.figure.add_axobserver(notify_axes_change)
Ctor for the LeoFigureManagerQt class.
def __init__(self, canvas, num):
    
    self.c = c = g.app.log.c
    super().__init__(canvas, num)
    self.canvas = canvas
    self.vr_controller = vc = vr.controllers.get(c.hash())
    self.splitter = c.free_layout.get_top_splitter()
    self.frame = w = QtWidgets.QFrame()
    w.setLayout(QtWidgets.QVBoxLayout())
    w.layout().addWidget(self.canvas)
    if vc:
        vc.embed_widget(w)

    class DummyWindow():

        def __init__(self, c):
            self.c = c
            self._destroying = None

        def windowTitle(self):
            return self.c.p.h
    self.window = DummyWindow(c)
    FocusPolicy = (QtCore.Qt.FocusPolicy if isQt6 else QtCore.Qt)
    self.canvas.setFocusPolicy(FocusPolicy.StrongFocus)
    self.canvas.setFocus()
    self.canvas._destroying = False
    self.toolbar = self._get_toolbar(self.canvas, self.frame)
    if (self.toolbar is not None):
        layout = self.frame.layout()
        layout.addWidget(self.toolbar)
        self.statusbar_label = QtWidgets.QLabel()
        layout.addWidget(self.statusbar_label)
        if (isQt5 or isQt6):
            pass
        else:
            self.toolbar.message.connect(self._show_message)
    self.canvas.draw_idle()

    def notify_axes_change(fig):
        if (self.toolbar is not None):
            self.toolbar.update()
    self.canvas.figure.add_axobserver(notify_axes_change)