Results 1 to 4 of 4

Thread: Removing Vertical Header from QStandardItemModel

  1. #1
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Removing Vertical Header from QStandardItemModel

    I would like to know how to remove the vertical and horzontial headers from a QStandardItemModel object. I have couple situations where either I need the vertical header but don't want the horizontal header and vice versa.

    Thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Removing Vertical Header from QStandardItemModel

    Sounds like you use table view so use:

    to access the headers and just hide() them.
    J-P Nurmi

  3. The following 2 users say thank you to jpn for this useful post:

    db (1st February 2008), mattc (14th May 2009)

  4. #3
    Join Date
    Jan 2008
    Location
    Vancouver, Canada
    Posts
    54
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Removing Vertical Header from QStandardItemModel

    Silly question, but how to dyou achieve this with a TableWidget?

  5. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Removing Vertical Header from QStandardItemModel

    Yes, QTableWidget is a QTableView. In other words, QTableWidget inherits QTableView, which is by the way mentioned right in the beginning of QTableWidget docs.
    J-P Nurmi

  6. The following user says thank you to jpn for this useful post:

    abrou (1st February 2008)

Similar Threads

  1. Replies: 3
    Last Post: 20th January 2011, 13:24
  2. Showing Icon in vertical header of a table
    By vishal.chauhan in forum Qt Programming
    Replies: 7
    Last Post: 15th January 2007, 10:44

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.