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. Find out when filtering is doing in QSortFilterProxyModel

Find out when filtering is doing in QSortFilterProxyModel

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 2.0k 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
    alizadeh91
    wrote on last edited by
    #1

    Hi guys..
    I've used a QSortFilterProxyModel. Now in filtering the tableview (by setFilterRegExp), i want to find out it somehow by model itself. But there isn't nothing such signal in QSortFilterProxyModel that emitted in this case. How can i find out when the filtering is doing?!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Santosh Reddy
      wrote on last edited by
      #2

      Filtering will be done as and when required and requested by View.

      What is that you want know from the Model?

      SS

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alizadeh91
        wrote on last edited by
        #3

        I want to know when the filtering is done in QSortFilterProxyModel.(If there is a signal or something like that in SFPM model).
        suppose i have a proxy model and when the filtering is done i want to have data in proxy model (for example its rowCount). The only way that i can do this is by connecting a signal from proxyModel to a slot. So i'm seeking for such a that signal or a way to implement this in my customProxyModel. How can i do this? Is there any other way or signal?
        Thanks a lot :)

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Santosh Reddy
          wrote on last edited by
          #4

          There is no such mechanism, even if it were there it would only create in-consistant results.

          I belive you want to know information like how many items have passed the filter test, or similar filtering outcoume information. In that case, you need have control over when and where setFilterRegExp() is called. Once this filrter is set emit a signal or call rowCount() on model etc....

          SS

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alizadeh91
            wrote on last edited by
            #5

            Yes i know and that works. but i thought that may be a wrong design to do that.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Santosh Reddy
              wrote on last edited by
              #6

              bq. but i thought that may be a wrong design to do that.

              What makes you think so? I don't think so as long we are talking abould Qt's MVC

              SS

              1 Reply Last reply
              0
              • A Offline
                A Offline
                alizadeh91
                wrote on last edited by
                #7

                Ok Thanks :) Problem resolved :)

                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