Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding list of check boxes in a single widget in Qt

Tags:

c++

qt

I'm using Qt Creator 2.0.1 (Qt 4.7). I need a widget which can hold multiple check boxes vertically. The check boxes will be added to the widget dynamically upon user interaction with other UI element. The widget will have fixed width and height so if there are too many check boxes, a vertical scroll bar should appear.

What I want is, imagine a QListWidget, where the list items can be check boxes.

Which widget will allow me to do that?

Thanks.

like image 944
Donotalo Avatar asked Nov 01 '10 01:11

Donotalo


1 Answers

Well you could indeed use a QListWidget with checkable items (see void QListWidgetItem::setFlags, or use a QScrollArea containing a QWidget where you would dynamically add QCheckBoxes. The choice is up to you!

like image 50
Luc Touraille Avatar answered Oct 06 '22 00:10

Luc Touraille