Results 1 to 2 of 2

Thread: QSortFilterProxyModel and get correct data

  1. #1
    Join Date
    Apr 2012
    Location
    Slovakia
    Posts
    12
    Qt products
    Qt4 Qt5
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default QSortFilterProxyModel and get correct data

    Hi quys

    First sorry my English, hope you understand me.

    "Problem":
    I need use QSortFilterProxyModel on my QML mobile apps. That's ok. Everything works fine, sorting, filtering all works, but my problem is that i cannot get correct data from item.

    For example:
    I have 4 items with some TITLE. Where are all displayed on the ListView then when i click on item, then show me (console.debug) TITLE of item according index. That's OK.
    The problem occurs when i use filtering then is (for example) displayed only 2 items, but the TITLE is same as before.

    EXAMPLE LIST
    ITEM 1
    ITEM 2 - click, print ITEM 2
    ITEM 3
    ITEM 4


    FILTERING ENABLED
    ITEM 1
    ITEM 4 - click, print me still ITEM 2


    I tried some examples of finished, one of them is this with small change
    filterproxy.zip
    source from http://www.developer.nokia.com/Commu...Search_with_Qt

    Thank you for answer, hope you understand me

  2. #2
    Join Date
    Apr 2012
    Location
    Slovakia
    Posts
    12
    Qt products
    Qt4 Qt5
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: QSortFilterProxyModel and get correct data

    Solved , but another problem. When i use filtering then rowCount value is wrong or is still like full items value. Is there a solution?
    THX

Similar Threads

  1. Replies: 7
    Last Post: 22nd August 2011, 16:35
  2. Replies: 1
    Last Post: 14th June 2011, 16:50
  3. Replies: 9
    Last Post: 11th April 2011, 11:05
  4. Sort huge data use QSortFilterProxyModel
    By jiaorenjie in forum Qt Programming
    Replies: 0
    Last Post: 16th March 2011, 03:56
  5. QSortFilterProxyModel with changing data
    By kemp in forum Qt Programming
    Replies: 4
    Last Post: 13th September 2010, 08:27

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.