def startStyleSheetEditor(self): try: self.ssEditor.activateWindow() except (AttributeError, RuntimeError): self.ssEditor = StyleSheetEditor(self) self.ssEditor.appearanceChanged.connect(self.onAppearanceChanged) self.ssEditor.resize(QSize(600, 550) * scaleRatio) self.ssEditor.show()