Unsolved QTableWidget set font for individual cells?
-
Is it possible to set different fonts for different QTableWidget cells?
I noticed that I can set a font for the headers but I really need different fonts within the table. -
@Publicnamer Use https://doc.qt.io/qt-5/qtablewidgetitem.html#setFont, please read the docs:
QFont font("Times", 10, QFont::Bold) auto item = tableWidget->item(row, column); item->setFont(font);
-
The font for a cell can be changed by returning the desired font for Qt::FontRole which you can set in your item via QTableWidgetItem::setFont().