class FrameStack(QtWidgets.QStackedWidget): def __init__(self, parent): super(FrameStack, self).__init__(parent) self.main_window = parent self.idialog = ImageDialog() self.idialog.hide() manual = os.path.join(parent.environ.doc_dir, AtAssistant.Manual) self.assistant = AtAssistant(manual, None) self.assistant.hide() self.log_window = LogWindow(self) self._wmap = dict() def showLogWindow(self): self.log_window.show() self.log_window.raise_() def addWidget(self, widget): wi = super(FrameStack, self).addWidget(widget) self._wmap[type(widget)] = wi def widgetByType(self, type_): return self.widget(self._wmap[type_]) def removeWidget(self, widget): del self._wmap[type(widget)] super(FrameStack, self).removeWidget(widget) def close(self): self.assistant.close()
def __init__(self, parent): super(FrameStack, self).__init__(parent) self.main_window = parent self.idialog = ImageDialog() self.idialog.hide() manual = os.path.join(parent.environ.doc_dir, AtAssistant.Manual) self.assistant = AtAssistant(manual, None) self.assistant.hide() self.log_window = LogWindow(self) self._wmap = dict()