PDA

View Full Version : How to get QComboBox selected item text to use in setModelData?



Tiansen
31st May 2010, 17:27
Hello,

I am writing custom delegate to show qcombobox when user wants to edit specific cell. I am using qsqltablemodel assigned to qtableview. My update mode is OnFieldChange. I notice that when I try to change value of qcombobox it is always reverted back to default mode. So setModelData of my delegate obviously cannot extract selected value and update database accordingly. I looked at default implementation of setModelData and figured out that qcombobox probably does not have property marked with USER flag. What am I missing here??

Tiansen
1st June 2010, 21:17
Bump. Bump.

gabizzz
28th April 2011, 15:43
qDebug(model->item(row,column)->text());