How to word wrap text in the rows and columns of a QTableWidget?
问题 I tried: QTableWidget *j = new QTableWidget (10000, 5, centralWidget); j->setColumnWidth (0, 500); j->setColumnWidth (1, 30); j->setColumnWidth (2, 30); j->setColumnWidth (3, 320); j->setColumnWidth (4, 310); j->setWordWrap (true); Also tried resizeColumnsToContents and resizeRowsToContents , but failed. If the text is longer than the set width, I want the sentence to break down. Currenty, the lengthy part of the sentence just doesn't get shown. 回答1: setWordWrap defines the behaviour of the