문제

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