Custom editor in QAbstractTableModel

Posted by Martin Beckett on Stack Overflow See other posts from Stack Overflow or by Martin Beckett
Published on 2010-04-22T23:08:13Z Indexed on 2010/04/22 23:13 UTC
Read the original article Hit count: 282

Filed under:
|
|

Does anyone have an example of using a QWidget as an editor in a QAbstractTableModel?
I have a column which when edited should create a QCombobox with the list of choices.

The docs seem to suggest I need to write a QAbstractItemDelegate and a custom paint function but that seems overkill to simply pop-up a standard QCombobox in Qt::EditRole.

Note - the combo box contents are the same for every row and it only needs to be shown when somebody clicks in the cell.

I know this should be simple but I can't get it to work. It's easy for a QTableWidget based table - but I need it for a very large data table.

© Stack Overflow or respective owner

Related posts about qt

Related posts about qabstracttablemodel