Search code examples
qtparentqwidgetqsplitter

How to remove QWidgets from QSplitter


In my app have a window splitted by a QSplitter, and I need to remove an widget.

How can I do that? I can't find useful methods


Solution

  • Many things in Qt cannot be "traditionally" removed. Instead call hide() on it and destruct it. From QSplitter documentation:

    When you hide() a child its space will be distributed among the other children. It will be reinstated when you show() it again.