Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    General and Desktop
    3
    6
    322
    Loading More Posts
    • 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.
    • alom
      alom last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • alom
          alom last edited by

          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 Reply Quote 0
          • Christian Ehrlicher
            Christian Ehrlicher Lifetime Qt Champion last edited by

            But it will emit begin/endRemoveRows for instance.

            Qt has to stay free or it will die.

            1 Reply Last reply Reply Quote 0
            • alom
              alom last edited by

              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 Reply Quote 0
              • Christian Ehrlicher
                Christian Ehrlicher Lifetime Qt Champion last edited by

                Sorry, I meant rowsInserted()/rowsRemoved()

                Qt has to stay free or it will die.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post