質問

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?

役に立ちましたか?

解決

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()

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top