1
votes

I implement custom delegate for QTableWidget to edit cell data like QComboBox. All works fine except one.

When user selects something in the combobox this changes does not applied while user will select another cell. The method QStyledItemDelegate::setModelData() of custom delegate not calling. So, user's changes are not applied.

What I should to do, to apply value in the combobox, after user makes selection?

1

1 Answers

4
votes

Your delegate should send the commitData signal when you want to write data to model. It will cause calling setModelData. In your case you need to emit commitData when QComboBox::currentIndexChanged signal is emitted by the widget.