PDA

View Full Version : List style for QTableWidget



cdonts
23rd August 2013, 01:38
Hello everybody. In my program I need a list with multiple columns. Since QListView and QListWidget doesn't support multiple columns (I've searched about that), I'm using a QTableWidget to display two columns and probably three or four in the future. I want this widget to look like a common list. What can I do? I'm currently hiding the grid with setShowGrid, but that doesn't resolve the problem. It stills looks and behave like a table. If click somewhere, I want the hole row to be selected, not only a cell. Even if I use setSpan, that will "erase" / disable / hide the rest of the cells. Is there any way to unify all the cells so it looks like a list?

Thanks and sorry for my English? :-)

wysota
23rd August 2013, 08:49
Use QTreeWidget, hide the header and disable root decoration.

cdonts
24th August 2013, 01:39
Nice. It works. Thanks!