PDA

View Full Version : QComboBox in QTreeView on Edit?



AyaKoshigaya
27th March 2012, 11:34
Hi,

I have an QTreeView with an QAbstractItemModel.
In one of my columns I'd like to display a QComboBox when editing instead of the normal text-editing (like in the QtDesigner for some values).

How would I do this?

Cheers,
Aya

wysota
27th March 2012, 19:16
Provide a custom delegate that will create a combobox as an editor for the view. Have a look at the spinbox delegate example that comes with Qt.