tags:

views:

128

answers:

2

It there a widget like this:

screenshot

It should be able to show/hide some contents under it.

+3  A: 

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.

BastiBense
It should be relatively simple to produce at any rate. A PushButton, a Label and whatever widget that needs to be hidden. Connect the `clicked()` signal of the push button to the `show()` slot of the widget which needs to be displayed.
laura
I agree that it is a trivial task, and wonder why it isn't implemented directly in Qt. BTW, pure QGroupBox/QCheckBox combination looks awkwardly. Maybe some styling should be applied
goodrone
I guess it's not there because nobody has implemented it yet. You can always report a feature request with the above screenshot in their issue tracker at http://bugreports.qt.nokia.com/ - I'm sure someone will implement it eventually.
BastiBense
+2  A: 

This QQ article (from the Qt 3 days) showcases how it can be done.

e8johan