def __init__(self, parent=None): super().__init__(parent) self.setFocusPolicy(Qt.StrongFocus) self.setAcceptDrops(True) self._currentTool = BaseTool() self._currentToolActivated = False self._eventFilter = KeyEventFilter(self) font = self.window().font_() self._layoutManager = LayoutManager(font, self) self._mouseDown = False self._preview = False self._defaultDrawingAttributes["showGlyphSelection"] = True # inbound notifications app = QApplication.instance() app.dispatcher.addObserver(self, "_needsUpdate", "glyphViewUpdate") app.dispatcher.addObserver(self, "_preferencesChanged", "preferencesChanged") self.readSettings()