Results 1 to 3 of 3

Thread: How to subclass QAbstractProxyModel

  1. #1
    Join Date
    May 2006
    Posts
    4
    Thanked 1 Time in 1 Post

    Default How to subclass QAbstractProxyModel

    The documentation for QAbstractProxyModel is rather minimal. I am looking for other documentation or an example of how to subclass it.

    In particular I want to create a proxy that flattens a hierarchical model. I only want to see the leaf items in a particular view.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to subclass QAbstractProxyModel

    If you want to see leaf subitems of an item, set the rootIndex of the view to the parent of the items you want to see. If you want to flatten a model, look here: http://www.thorsen-consulting.dk/freebies.html

  3. #3
    Join Date
    Mar 2008
    Location
    Marslev, Denmark
    Posts
    31
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: How to subclass QAbstractProxyModel

    A couple of people have asked about the FlatProxyModel, so I'll upload it to my website again. The site is now called http://www.fioniasoftware.dk because my old company (Thorsen Consulting) went under during the first year of the finansial crisis.

    I'll also write a blog entry on my Qt blog at http://www.fioniasoftware.dk/blog.

    If you need this before I get the code uploaded, send a mail to bo@mynewdomainyoucanseeabove and I'll mail you the code.

Similar Threads

  1. QAbstractProxyModel and QTreeView
    By niko in forum Qt Programming
    Replies: 5
    Last Post: 18th January 2008, 21:17
  2. QSqlQueryModel write subclass
    By skuda in forum Qt Programming
    Replies: 6
    Last Post: 29th October 2007, 16:18
  3. QAbstractProxyModel and "virtual" columns
    By tranfuga25s in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2007, 23:39
  4. QT4: Sorting in QTreeWidget (subclass)
    By Michiel in forum Qt Programming
    Replies: 21
    Last Post: 29th March 2006, 18:08
  5. QFrame subclass does not reparent
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 21st March 2006, 22:15

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.