Results 1 to 4 of 4

Thread: Need to call QTableView::invalidate() before hiding columns

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2010
    Posts
    15
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Need to call QTableView::invalidate() before hiding columns

    I'm having trouble understanding why I need to call QTableView::invalidate() before I can hide columns in the view.

    Here m_proxy is a subclassed QSortFilterProxyModel with a reimplemented filterAcceptsRow and m_view is just QTableView.
    Qt Code:
    1. m_view->setColumnHidden(5, true);
    2. qDebug() << m_view->isColumnHidden(5);
    3.  
    4. m_proxy->invalidate();
    5.  
    6. m_view->setColumnHidden(5, true);
    7. qDebug() << m_view->isColumnHidden(5);
    To copy to clipboard, switch view to plain text mode 

    The above code returns:
    false
    true
    I am actually having trouble hiding columns elsewhere in my code which I how I stumbled on this curiosity.

    Thanks for any explanations!
    Last edited by brixton; 9th December 2010 at 18:58. Reason: reformatted to look better

Similar Threads

  1. Validator for QTableView columns
    By sasi in forum Qt Programming
    Replies: 0
    Last Post: 6th October 2009, 08:10
  2. Don't resize columns - QTableView
    By estanisgeyer in forum Qt Programming
    Replies: 1
    Last Post: 26th January 2009, 16:59
  3. Different delegates to different Columns of QTableView.
    By kaushal_gaurav in forum Qt Programming
    Replies: 4
    Last Post: 6th August 2008, 09:17
  4. autoexpanding QTableView columns
    By ucntcme in forum Qt Programming
    Replies: 6
    Last Post: 11th March 2008, 09:28
  5. Moving columns/hiding columns in QTreeView
    By yogeshm02 in forum Qt Programming
    Replies: 4
    Last Post: 14th March 2007, 16:22

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.