Results 1 to 3 of 3

Thread: Suppress drawing of rows

  1. #1

    Default Suppress drawing of rows

    How does one suppress the drawing of rows in a QTreeView? I have a custom QAbstractItemModel set up with each node being a QStandardItem. Child nodes are added with appendRow. I would like to be able to add children to certain nodes, but basically have them not be represented in the view. I've tried subclassing the view and playing with drawRow and such, but have had no success. The most I could make happen was to have it draw blank rows, but the space for the rows was still there. I also have delegates set up for certain nodes.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Suppress drawing of rows

    Quote Originally Posted by Strongoloid View Post
    How does one suppress the drawing of rows in a QTreeView?
    Hi, you could use QSortFilterProxyModel for filtering the non wanted rows out.

  3. #3

    Default Re: Suppress drawing of rows

    Thanks, I will try that. I'm guessing I will need to reimplement the filterAcceptsRow function.

Similar Threads

  1. Problems with QString
    By cyberboy in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2008, 08:18
  2. QSqlTableModel inserts empty rows
    By Nesbitt in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2008, 12:47
  3. QTableWidget sorting with hidden rows
    By alex140773 in forum Qt Programming
    Replies: 0
    Last Post: 8th July 2008, 12:35
  4. Removing rows
    By indifference in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2007, 16:54
  5. Replies: 1
    Last Post: 28th September 2006, 06:21

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.