Question

I put some text in QTableWidget's cells, like this:

tableWidget.setItem(row, col, QtGui.QTableWidgetItem(myText))

and scrolling through table is very slow (1fps or less) over rows which have QTableWidgetItems with myText length over 5000 (+/-1000)

I need tableWidget.resizeRowsToContents() and I thought it has to have something with rows height so I tried tableWidget.setRowHeight(i,1000) for those rows. Text in them was cuted and I have to resize row's height in order to see all text, but still, when scrolling over those rows, performances are very low.

Is there some quick solution for this? I would not like to use setCellWidget if possible. Any help would be appreciated.

Était-ce utile?

La solution

Since there was no other solution,I had to put text that has length over 5000 in QTextEdit and use setCellWidget. Scrolling table is not slow anymore. Reason I didn't put them all in QTextEdits is that Windows7 can show limited number of GUI elements (<20000 I think) and I have 10 columns x up to 100000 rows.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top