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. QSortFilterProxyModel how to emit a custom signal when filterAcceptsRow is finished?
QtWS25 Last Chance

QSortFilterProxyModel how to emit a custom signal when filterAcceptsRow is finished?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 693 Views
  • 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.
  • alomA Offline
    alomA Offline
    alom
    wrote on last edited by
    #1

    Hi,
    I have a proxy model(treeview with parent/children) where I have implemented some custom filtering in filterAcceptsRow. Is there any way to manage the filtering to emit a signal once the recursion has finished?

    Would I have to find the very last item on the source model and test if its passed in the filterAcceptsRow to trigger a signal or something?

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you explain what the goal of this signal ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • alomA Offline
        alomA Offline
        alom
        wrote on last edited by
        #3

        I'd like to modify the remaining parents of the leafs after the filtering.
        ex.expand the parent to show all leafs, along with changing the Decoration.Role and changing some custom UserRoles

        It looks like the proxy model only emits layoutChanged() once sorting is finished but not filtering.

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          But it will emit begin/endRemoveRows for instance.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • alomA Offline
            alomA Offline
            alom
            wrote on last edited by
            #5

            hmm i cant seem to catch begin/endRemoveRows, are those signals? or are you saying to try and re-implement those and add a signal there?

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Sorry, I meant rowsInserted()/rowsRemoved()

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              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