No, I meant return literally "QVariant()" (an empty QVariant instance). Returning QVariant( Qt::Checked ) still results in the table seeing a Boolean value instead of nothing.I added QVariant to the code but the table still displays boolean as ture or false.
I think you are misunderstanding what a delegate does. Delegates are -only- used when editing an item in a table or tree view. When the editing is finished, the editor is destroyed and the model is updated. So if you create a checkbox delegate, it will be displayed only when you are actually editing the cell with the Boolean item, otherwise it will not be visible.Checkbox is not displayed when I don't click.
If you want something to be visible all of the time, you will have to implement the paint() method to draw the checkbox -image-.
Personally, I think you are chasing this too far. You don't need a delegate for checkboxes, since QTableView already provides one. Did you try my suggestion of connecting a slot to the QItemSelectionModel?




Reply With Quote
Bookmarks