Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Reorder results after filtering data using QSortFilterProxyModel
Forum Updated to NodeBB v4.3 + New Features

Reorder results after filtering data using QSortFilterProxyModel

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 430 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arginite
    wrote on last edited by
    #1

    Is it possible to reorder the results gotten from filtering data using QSortFilterProxyModel?

    I have a treemodel:

    • parentitem
      • childitem
      • childitem
    • parentitem
      • childitem
      • childitem
        etc

    I want to apply a QSortFilterProxyModel to this so that I can allow users to search the tree data, then I want to restructure the result from filtering the data so that I end up with this:

    • childitem

    • childitem

    • parentitem

      • childitem
      • childitem

    All child items that matched the search will be shown as root level items.
    All parent items that match the search will be shown including all there child items even if they do not match the search.

    After much head scratching I don't think this can be done using QSortFilterProxyModel, if not how can I achieve the desired result?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved