QWidget
has functions show()
and hide()
, if Application1 is inside QWidget
or any other widget inheriting QWidget
, you can call hide
on the object of that widget when user clicks on Single
button, (widget.hide()
). When user clicks on Split
button you can call show()
on the same object to show the widget.
Edit
Another way of achieving this would be:
to set the size of QSplitter
. When Single
Button is pressed, do the following:
splitter.setSizes([self.width(), 0])
When split
button is pressed do the following:
splitter.setSizes([self.width()/2, self.width()/2])
Assuming that the self
refer to mainWindow containing the splitter and self.width()
gives the width of mainWindow.