Results 1 to 5 of 5

Thread: get rid of grid lines & vertical table header in QTableView

  1. #1
    Join Date
    Nov 2012
    Posts
    35
    Thanks
    1
    Thanked 7 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question get rid of grid lines & vertical table header in QTableView

    Screen Shot 2013-12-08 at 9.56.58 PM.jpg

    How can I get rid of grid lines and vertical header of QTableView and display text underneath the image instead of being displayed on the right of image ?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: get rid of grid lines & vertical table header in QTableView

    How can I get rid of grid lines
    Qt Code:
    1. view->setShowGrid(false);
    To copy to clipboard, switch view to plain text mode 
    and vertical header of QTableView
    Qt Code:
    1. view->verticalheader()->setVisible(false);
    To copy to clipboard, switch view to plain text mode 
    and display text underneath the image instead of being displayed on the right of image ?
    Use a delegate, but consider whether QListView with QListView::setViewMode() with QListView::IconMode is a better fit first

  3. The following user says thank you to ChrisW67 for this useful post:


  4. #3
    Join Date
    Nov 2012
    Posts
    35
    Thanks
    1
    Thanked 7 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: get rid of grid lines & vertical table header in QTableView

    Quote Originally Posted by ChrisW67 View Post
    Qt Code:
    1. view->verticalheader()->setVisible(false);
    To copy to clipboard, switch view to plain text mode 

    Use a delegate, but consider whether QListView with QListView::setViewMode() with QListView::IconMode is a better fit first
    Doesn't work in python
    Qt Code:
    1. self.verticalheader().setVisible(False)
    To copy to clipboard, switch view to plain text mode 

    i do not know how to use delegate, could you please refer me some example.

    Thanks!!!

  5. The following user says thank you to krystosan for this useful post:


  6. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: get rid of grid lines & vertical table header in QTableView

    Not literally no... But then you did not ask for python. You need to identify the vertical header object of the view in a Pythonic fashion and then you need to call its setVisible method. If I had to guess then
    Qt Code:
    1. self.verticalHeader.setVisible(false)
    To copy to clipboard, switch view to plain text mode 

    QStyledItemDelegate but do check out the QListView first.

  7. The following user says thank you to ChrisW67 for this useful post:


  8. #5
    Join Date
    Nov 2012
    Posts
    35
    Thanks
    1
    Thanked 7 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: get rid of grid lines & vertical table header in QTableView

    Quote Originally Posted by ChrisW67 View Post
    Not literally no... But then you did not ask for python. You need to identify the vertical header object of the view in a Pythonic fashion and then you need to call its setVisible method. If I had to guess then
    Qt Code:
    1. self.verticalHeader.setVisible(false)
    To copy to clipboard, switch view to plain text mode 
    got it this way
    Qt Code:
    1. def headerData(self, section, orientation, role):
    2. if role == QtCore.Qt.DisplayRole:
    3. if orientation == QtCore.Qt.Vertical:
    4. return None
    To copy to clipboard, switch view to plain text mode 

  9. The following user says thank you to krystosan for this useful post:


Similar Threads

  1. Vertical label on table horizontal header
    By ipkiss in forum Qt Programming
    Replies: 1
    Last Post: 11th February 2014, 20:03
  2. Replies: 3
    Last Post: 20th January 2011, 14:24
  3. Resizing vertical header in QTableView
    By p.csakany in forum Qt Programming
    Replies: 3
    Last Post: 2nd November 2010, 00:06
  4. Qtableview Vertical header order
    By Darthspawn in forum Qt Programming
    Replies: 4
    Last Post: 26th March 2010, 16:10
  5. Showing Icon in vertical header of a table
    By vishal.chauhan in forum Qt Programming
    Replies: 7
    Last Post: 15th January 2007, 11:44

Tags for this Thread

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.