How can I align my table widget items in center ? My first column was a QCheckBox
, but I checked documents , seems you can only set alignment for QTableWidgetItem
, not the cell widget inside.
Thanks
Setting model to your TableWidget (with data virtual implementation) I think will help. QVariant QAbstractItemModel::data ( const QModelIndex & index, int role = Qt::DisplayRole ) const [pure virtual] and return the needed alignment if role is an alignment.