Unsolved How do I set some characters bold in QTableWidgetItem?
-
I want to bold some of the characters in the cells of the QTableWidget.
example:)
(the character with 't' is bold)
"I'm table widget item!"QTableWidgetItem does not seem to be able to apply a font to some characters.
How can I solve this problem?
Thank you.
-
You have two options. QTableWidgetItem does not support rich text.
- Use the setCellWidget(..) with QLabel which support rich text
- User your own Custom delegate.
for(int i=0;i<4;i++){ for(int j=0;j<4;j++){ QLabel *lb = new QLabel("<b>D</b>eerendra"); ui->tableWidget->setCellWidget(i,j,lb); } }
-
@dheerendra said in How do I set some characters bold in QTableWidgetItem?:
User your own Custom delegate.