PDA

View Full Version : No checkboxes are displayed in a QTableView



NoRulez
15th October 2010, 16:55
Hello,

i use a QSqlTableModel and a QTableView to show the data of the model.
I inherit the QSqlTableModel and return also the Qt::ItemIsUserCheckable flag in the flags() function. But i didn't get a checkbox displayed. What I'm doing wrong?

I need something like the following:


[X] Product 1
[ ] Product 2
[X] Product 3


Did I need a reimplementation of a delegate or should it also work as it is?

Thanks in advance

Best Regards
NoRulez

Lykurg
15th October 2010, 17:28
You also have to ensure that the data() function is returning a valid value for Qt::CheckStateRole.