Question

This question is pretty straightforward: I have a QGroupBox object that initially has a QTableView inside of it. When the user clicks a certain button, I need the QTableView object to be removed, leaving just an empty QGroupBox. I know I can use addWidget() to create a table inside of the QGroupBox, but after looking around the docs for a while I'm having a hard time finding a similar function to remove widgets. Is there any way to do this? Thanks!

Note: I just found that there's an isEmpty() function related to the groupBox->layout(), is there maybe something similar with the layout to access the widgets if that function returns false?

Était-ce utile?

La solution

You can use QTableView::hide() to hide it from QGroupBox.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top