I am having issues setting font weight for a column inside QTableView's model.
I found that I can use QFont for it, but I cannot find a way to set only the font weight, I want the text bolded for some cells.
I tried it like this:

Qt Code:
  1. QVariant ModelLIes::data(const QModelIndex &index, int role) const{
  2. QVariant value = QSqlQueryModel::data(index, role);
  3. if(index.column() == 5){
  4. if(role == Qt::FontRole){
  5. int valStare=QSqlQueryModel::data(index, Qt::DisplayRole).toInt(); // to check which cells to modify in the column
  6. QFontInfo info(QSqlQueryModel::data(index, Qt::DisplayRole).toString());
  7. int marime=info.pointSize(); //tried also pixelSize();
  8. QString fam=info.family();
  9. if(valStare==1)
  10. return QFont(fam, marime,QFont::Bold);
  11. }
  12. }
  13. return value;
  14. }
To copy to clipboard, switch view to plain text mode 

But the font is different from the rest of my tableview.(Is it setting the font size and family to what I am using on my OS?)

Any suggestions?