I think this works (I don't try it):
You need to subclassing "QStyledItemDelegate" (or "QItemDelegate") and reimplementing its "paint" function, example:
Qt Code:
  1. //MyItemDelegate is subclass of QStyledItemDelegate
  2. void MyItemDelegate::paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const
  3. {
  4. QStyleOptionViewItem opt = option;
  5. opt.decorationAlignment = Qt::AlignCenter;
  6. QStyledItemDelegate::paint(painter, opt, index );
  7. }
  8.  
  9. //your app body
  10. table->setItemDelegate(new MyItemDelegate);
To copy to clipboard, switch view to plain text mode