You can use QTableView::hide() to hide it from QGroupBox.
Qt - How to clear the contents of a QGroupBox UI object
-
13-06-2023 - |
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?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow