It there a widget like this:
It should be able to show/hide some contents under it.
It there a widget like this:
It should be able to show/hide some contents under it.
No. The only widget which does something similar to that is QToolBox
.
It should be rather easy to create a widget which acts like what you need, though. You could for instance use the "enable/disable checkbox" feature of QGroupBox and have it replaced by a QPushButton or something similar whenever it is disabled.
But I assume that subclassing QWidget and managing it yourself is the simplest approach.
This QQ article (from the Qt 3 days) showcases how it can be done.