Results 1 to 5 of 5

Thread: how to filer a QAbstractTableModel model

  1. #1
    Join Date
    Feb 2012
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy how to filer a QAbstractTableModel model

    I have created a QAbstractTableModel tableModel and QAbstractListModel listModel and set these model to respective views (QTableView and QListView).I want to filter the tableModel based on the listModel.That mean when someone clicks on a list item and the tableview should be fliter based on the list item.The model are working perfectly.Please help

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to filer a QAbstractTableModel model

    Have a look at QSortFilterProxyModel
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    learningqt (9th March 2012)

  4. #3
    Join Date
    Feb 2012
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Red face Re: how to filer a QAbstractTableModel model

    Do you have any example on how i can use it...I was reading on QAbstractProxyModel...any sample code...thankz

  5. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to filer a QAbstractTableModel model

    .I was reading on QAbstractProxyModel
    if you did how come you missed this:
    http://qt-project.org/doc/qt-4.8/ite...ltermodel.html
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  6. The following user says thank you to high_flyer for this useful post:

    learningqt (9th March 2012)

  7. #5
    Join Date
    Feb 2012
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to filer a QAbstractTableModel model

    I am actually trying that out...:P

Similar Threads

  1. setData in a model derived from QAbstractTableModel
    By enno in forum Qt Programming
    Replies: 2
    Last Post: 1st November 2010, 14:11
  2. QAbstractTableModel and tooltip
    By mpi in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2010, 19:58
  3. QAbstractTableModel and sort
    By foxyproxy in forum Qt Programming
    Replies: 7
    Last Post: 25th March 2008, 09:30
  4. Using QAbstractTableModel.parent
    By Max Yaffe in forum Newbie
    Replies: 7
    Last Post: 15th June 2007, 15:21
  5. QAbstractTableModel for QTreeView?
    By Michiel in forum Qt Programming
    Replies: 5
    Last Post: 15th May 2007, 09:09

Tags for this Thread

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.