pyside show / hide layouts
问题 I'm trying to display one of two layouts depending on whether a checkbox is checked or not. Only using widgets I can do the following which works fine: (each widget in this example is a QLineEdit) myCheckbox.stateChanged.connect(switchControls) def switchControls (self, state): if state == 2: self.widget1.show() self.widget2.hide() else: self.widget1.hide() self.widget2.show() However, since I want to add a descriptive label to each QLineEdit, I need to combine a QLineEdit+QLabel in a layout