Results 1 to 2 of 2

Thread: Model/View: display data in different views depending on content

  1. #1
    Join Date
    Jan 2008
    Posts
    56
    Thanks
    7
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Model/View: display data in different views depending on content

    Hi all,

    I have a custom model derived from QAbstractTableModel and I use several views to display the data.
    For sake of simplicity let's assume that the table has an int and a string where the int ranges from 1 to 4.
    Then, I need 4 views and each view shall only show the rows with the corresponding int, that is, view1 shows all rows containing the int 1, etc.
    I assume that this can be done with different roles.
    How can I tell the view to show only a subset of the whole data in the model?

    Thanks in advance.

    Rainer

  2. #2
    Join Date
    Jan 2008
    Posts
    56
    Thanks
    7
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Model/View: display data in different views depending on content

    Hi all,

    just found QSortFilterProxyModel. I guess that is the right way.
    Will try that.

    Regards,

    Rainer

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.