Question

I've a QTableWidget and a QTableModel.

I want to create a column in which there are combobox instead of text.

I've found some answer, like this one but they talk about fixed size tables.

I use instead QAbstractTableModel::insertRows() and QAbstractTableModel::removeRows() in order to change at Runtime the number of rows.

How can I add rows with the combobox at specified column in this case?

Was it helpful?

Solution

The same way it's done in answer you find. ( table->setCellWidget ( row, col, new QComboBox( table ) ); ) The only problem is that you need to know which exact rows you've added with insertRows()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top