How do I implement a QTableWidgetItem where the text is toggled on and off between letters in the item?

Viewed 25

I have a QTableWidget* table, where I am setting new QTableWidgetItem* item at each cell with table->setItem(i, j, item). My trouble is that I need the item to be a string which toggles a bold font on a particular condition for each letter. It seems as though Qt will only allow me to set the font of the entire string. I've looked into delegates already using this guide but this seems excessive for such a trivial task. How can I do this? As you can see in the picture below, the third column sets a string which toggles a bold font on and off.

Example of my QTableWidget

0 Answers
Related