Results 1 to 7 of 7

Thread: Table cell merge/join

  1. #1
    Join Date
    Jun 2006
    Location
    San Jose, CA
    Posts
    53
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Table cell merge/join

    Hi,
    is there a way in qt4 to merge/join table cells?
    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Table cell merge/join

    AFAIK it is planned but not available yet (see QAbstractItemModel::span()).

  3. #3
    Join Date
    Jun 2006
    Location
    San Jose, CA
    Posts
    53
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Table cell merge/join

    Thanks for the info - Is there a way of changing the border color for the table cells so that I can simulate merged cells?
    Thanks.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Table cell merge/join

    You can turn off grid drawing in the table and draw the grid using delegates/tablewidgetitems.

  5. #5
    Join Date
    Jun 2006
    Location
    San Jose, CA
    Posts
    53
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Table cell merge/join

    I see "bool showGrid () const" to control the grid but, it's not quite clear to me how to draw the lines per cell using QItemDelegate. Do you have by any chance an example?
    Thanks a lot.

  6. #6
    Join Date
    Jun 2006
    Location
    San Jose, CA
    Posts
    53
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Table cell merge/join

    Never mind - I found a similar thread http://www.qtcentre.org/forum/f-qt-p...able-1215.html
    I will try that first.
    Thanks again for all the help.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Table cell merge/join

    An example... hmm... You can look at model-view examples (custom delegate) bundled with Qt. A quickstart is to inherit QItemDelegate and reimplement its paint() method and draw a frame you need around the cell before calling QItemDelegate::paint() to do the rest.

Similar Threads

  1. displaying any table on a qdatatable
    By Philip_Anselmo in forum Newbie
    Replies: 4
    Last Post: 9th May 2006, 22:12
  2. creating table plugin
    By mgurbuz in forum Qt Programming
    Replies: 3
    Last Post: 28th April 2006, 13:50
  3. Adding row in a Table after selected row
    By ankurjain in forum Qt Programming
    Replies: 3
    Last Post: 20th April 2006, 18:06
  4. Table model / view editing issue
    By Caius Aérobus in forum Qt Programming
    Replies: 9
    Last Post: 7th April 2006, 11:03
  5. Highlighting the border of cell in Table
    By ankurjain in forum Qt Programming
    Replies: 8
    Last Post: 21st March 2006, 08:20

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.