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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top