Results 1 to 2 of 2

Thread: How to filter columns with numbers when subclassing QSortFilterProxyModel?

  1. #1
    Join Date
    Jul 2019
    Posts
    3
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Question How to filter columns with numbers when subclassing QSortFilterProxyModel?

    Hi guys, I am new to QT.

    Now I am trying to realize a project but meet some problems.

    I wanna filter one column which contains numbers only, for example I wanna the table view shows rows with number less than 100 in this columns. I used setFilterRegExp and setFilterKeyColumn to filter columns with strings. However, I don't find the way to filter with numbers.

    I think I should subclass QSortFilterProxyModel to do it but I don't know how to do it...

    Can anyone help me? Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    445
    Thanked 61 Times in 57 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to filter columns with numbers when subclassing QSortFilterProxyModel?

    You have to reimplement QSortFilterProxyModel::filterAcceptsRow()

Similar Threads

  1. Filter columns in QAbstractItemModel
    By Djab in forum Qt Programming
    Replies: 3
    Last Post: 3rd August 2012, 16:32
  2. Filter a Filtered QSortFilterProxyModel !?
    By solook in forum Qt Programming
    Replies: 4
    Last Post: 25th October 2011, 19:22
  3. Subclassing QSortFilterProxyModel problem
    By e79ene in forum Newbie
    Replies: 2
    Last Post: 21st February 2011, 13:23
  4. Replies: 8
    Last Post: 14th August 2008, 15:48
  5. Subclassing QSortFilterProxyModel
    By r366y in forum Qt Programming
    Replies: 2
    Last Post: 14th June 2006, 15:26

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.