I have a QTreeView with a custom model. In that model I display boolean types with a checkbox using the CheckStateRole. I have nothing in the DisplayRole which basically gives you a checkbox and nothing else in that cell. Does anyone have a good idea of how to get that checkbox to be center aligned in the cell?

Unfortunately the Qt::TextAlignmentRole doesnt affect the checkbox. I suppose its possible to use a proxy style but I have no clue how to correctly implement it. Any ideas? Code?