0

I have a QTableView linked to a QSqlTableModel. In this table, there is a column that is a integer. Each value of this one matches with a QString. I already used a QComboBox delegate in order to select the QString when editing. But when the value is edited, it is displayed as an integer.

What I want to do is to display the value as a QString with the corresponding integer value.

I looked in QAbstractProxyModel class but I am not totally sure that it can solve my problem.

Can you confirm this way (subclassing QAbstractProxyModel) or using another one?

Thanks for your answers.

László Papp
  • 51,870
  • 39
  • 111
  • 135
Tristan Djahel
  • 1,082
  • 2
  • 12
  • 22

1 Answers1

0

You should reimplement your delegate paint method to display text.

You can check classic star delegate example. In your case everything is much simplier: you should draw just a text.

hank
  • 9,553
  • 3
  • 35
  • 50