PDA

View Full Version : customizing table widget



krishna.bv
25th January 2007, 13:37
hi, our project requires customizing the table widget to get the required look.
please find the picture EXISTING.jpeg to find the current layout. this has to be replicated using Qt.

Our implementation went like this:
1. Made the actual comment window, and row window using Qt desinger.(see pic NEW.jpeg)
2. Made individual classes for both the ui files.
3. add button click has to add a new row window class in above the existing row window pushing it down.
4. Delete button press has to remove the lastes row window from the talbe widget.

Our problem is we are unable to add the row class into the table widget, even when we using the method setCellWidget()

also please find the code attached.

expecting immediate help and thanking in advance.

krishna.

wysota
25th January 2007, 13:43
You have to create three separate widgets (one for each column) and then either use setCellWidget() to place widgets into columns (but in practice you won't be able to use the table widget in any way) or openPersistentEditor() to interconnect widgets with the model-view framework. If you choose the latter solution, first wrap your editor widgets into a delegate and set the delegate for the table.