Results 1 to 3 of 3

Thread: how to remove the span set for a cell in QTableView

  1. #1
    Join Date
    Oct 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default how to remove the span set for a cell in QTableView

    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!

  2. #2
    Join Date
    Oct 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default I'd like to present the problem with more details

    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!

  3. #3
    Join Date
    Oct 2008
    Posts
    4
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to remove the span set for a cell in QTableView

    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,

  4. The following user says thank you to stephanyShulter for this useful post:

    Jolly (16th May 2010)

Similar Threads

  1. QTableView currentChanged <> selecting header
    By Everall in forum Qt Programming
    Replies: 4
    Last Post: 1st April 2009, 08:24
  2. Replies: 2
    Last Post: 10th May 2006, 03:14
  3. Copying contents of QTableView cell to clipboard
    By Conel in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2006, 15:50
  4. QTableView change color of current Cell
    By raphaelf in forum Qt Programming
    Replies: 4
    Last Post: 4th March 2006, 11:22
  5. QSettings again ... how to remove array elements
    By Mike in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2006, 08:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.