QTableWidget: different styles in *one* QTableWidgetItem?
问题 Is it possible to have a two-line element in a cell (QTableWidgetItem) of a QTableWidget with different styles per line? I want to have the first line bold and the second line not bold. Or can I add two QTableWidgetItems in one cell? Do a cellspan somehow? Cheers Matthias 回答1: Simple way : Checkout the setCellWidget method of QTableWidget. If you replace the default widget with QTextEdit, you can get rich text formatting capability. Better way : Use a custom QStyledItemDelegate. You can see