def addTopWidget(self, widget): mh.addTopWidget(widget) self.widgets.append(widget) widget._parent = self if self.isVisible(): widget.show() else: widget.hide() return widget