I have a button followed by a QGridLayout
full of widgets.
I want to show/hide QGridLayout
at every button click, but reading documentation of QGridLayout
I see there's no show()
/hide()
implementation, also no setVisible()
method available.
How do I achieve this?
Layouts only affect the size/position of the widgets added to them - for visibility (and anything else - event handling, focus, enable+disable) you care about the parent widget, as mentioned above. QLayout::parentWidget() gives you the widget which owns the layout, which you can then show and hide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With