Results 1 to 8 of 8

Thread: How to remove headers from QTableView.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    26
    Thanked 1 Time in 1 Post

    Thumbs up How to remove headers from QTableView.

    Hi All,

    I am having QTableView, For this view i am using QStandardItemModel My Code is like this,

    Qt Code:
    1. QTableView *m_pTimeTableView;
    2. QStandardItemModel *m_pTableModel ;
    3.  
    4. m_pTableModel = new QStandardItemModel(0,5,this);
    5.  
    6. m_pTableModel->setColumnCount(5);
    7.  
    8. m_pTableModel->insertRow(0);
    9. m_pTableModel->setData(m_pTableModel->index(0, 0), 160);
    10. m_pTableModel->setData(m_pTableModel->index(0, 1), 123);
    11. m_pTableModel->setData(m_pTableModel->index(0, 2), "XYZ");
    12. m_pTableModel->setData(m_pTableModel->index(0, 3), "XYZ");
    13. m_pTableModel->setData(m_pTableModel->index(0, 4), "XYZ");
    14.  
    15. m_pTimeTableView->setModel(m_pTableModel);
    To copy to clipboard, switch view to plain text mode 
    If i do this I am getting headers in both horizantal and vertical .. and i am getting one more extra column at last .

    I want to remove Headers and extra columns in the end. How to do this?
    Last edited by jpn; 27th March 2008 at 09:29. Reason: missing [code] tags
    Thanks,
    Rajesh.S

Similar Threads

  1. Remove selected rows from a QTableView
    By niko in forum Qt Programming
    Replies: 4
    Last Post: 3rd March 2016, 13:49
  2. how to remove the span set for a cell in QTableView
    By dandanch in forum Qt Programming
    Replies: 2
    Last Post: 21st October 2008, 12:22
  3. remove node in xml file
    By mattia in forum Newbie
    Replies: 1
    Last Post: 6th March 2008, 14:25
  4. QTableView : headers disappear
    By xavier in forum Qt Programming
    Replies: 2
    Last Post: 8th May 2006, 17:57
  5. QSettings again ... how to remove array elements
    By Mike in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2006, 09: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
  •  
Qt is a trademark of The Qt Company.