PDA

View Full Version : Lists/multiline text in QTableView cells



dv_
19th June 2008, 18:16
Hello,

I have a problem regarding the QTableView cells. The model provides QStrings for the first 3 columns - but the data for the 4th is a string list, not just a string.

Now, I see two options:

1) Put a combobox in the 4th column cells. Like here: http://doc.trolltech.com/4.3/images/icons_monkey.png
However, I do not know how. Using delegates maybe? But the delegates have a paint() call, no "widget()" method or something similar.

2) Display multiline text in the cells. Unfortunately, the standard delegate does not understand \n and \r characters, and displays the entire thing as one long string.

Any ideas?

jacek
22nd June 2008, 23:43
2) Display multiline text in the cells. Unfortunately, the standard delegate does not understand \n and \r characters, and displays the entire thing as one long string.
You can subclass the delegate and make it display multiline text for that column.