PDA

View Full Version : how to remove the span set for a cell in QTableView



dandanch
15th November 2006, 08:27
QTableView::setSpan()
I found it is hard to remove the span which was set earlier.
If with span, the removeRow or removeColumn will be screwed up, not the whole row or column is removed

Can someone help me out with a solution?
Thanks!

dandanch
15th November 2006, 17:05
I will show a QTableWidget, the cells in the first two rows are processed with columnSpan() so that they can illustrate the layer relationship between the underlying single columns.
For example: the final effect will be like this:
| Item1 | Item2 | Item3 |
| 1-1 | 1-2 | 1-3 | 2-1 | 2-2 | 2-3 | 3-1 | 3-2 |
| | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | |

I don't have problem to generate the above table with the columnSpan() method.
But another requirement is to hide some parts of the columns, for example, the whole Item2 or Item2-1. When I use the hideColumn(), the first two rows are screwed up because of the span setting
I even tried to delete the first two rows, but the spans are still there.
Can someone help me with a feasible solution? Thanks a lot!

stephanyShulter
21st October 2008, 11:22
Hello,

Did you manage to find the right solution ? I mean I'm also encountring the same probleme well to some extent.

I suppose to remove a span from a cell is to reset it's span value to 1. may work


regards,