QTableView QCheckBox QComboBox
-
Views display checkboxes if the model has the userCheckable flag set, and the model returns valid data for the Qt::CheckStateRole.
To use a combo box as your editor, you will need to set an appropriate QItemDelegate subclass that creates a combobox as the editor widget.
The model will give you a generic dataChanged() signal if the data is modified. Depending your your model, you may get more specific signals from there.
-
If you create your own custom model, YOU must take care of signals like dataChanged etc.
To get more info on that, read "an editable model":http://doc.qt.nokia.com/4.7/model-view-programming.html#an-editable-model -
Yes, the editor is created when the user starts editing the cell.
If you want your QComboBox to appear all the time, I guess you'll have to reimplement the paint method of your delegate and draw the QComboBox by yourself. See "QStyle::drawComplexControl":http://doc.qt.nokia.com/latest/qstyle.html#drawComplexControl
-
There's a wiki article "Combo Boxes in Item Views":http://developer.qt.nokia.com/wiki/Combo_Boxes_in_Item_Views that shows you how to create a [[Doc:QStyledItemDelegate]] subclass for that task.