How to set font size to horizontal header of QTableView
I tried to find solution for this on google but I couldn't.
I tried set font size in both code and stylesheet but they don't work:
Please help, thanks.
You could try to use the relevant data role in QAbstractItemModel::headerData for that.
I will try and report back to you. Thank you.
I tried to find some relevant data role in QAbstractItemModel::headerData and thought that FontRole can help me. But nothing's change even I used FontRole
@QVariant UploadedTableModel::headerData(int section, Qt::Orientation orientation, int role) const
if (role == Qt::FontRole)
return QFont("Tahoma", 14);
Maybe I miss something else. Can you please advice?