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. Updating a proxy model
Forum Updated to NodeBB v4.3 + New Features

Updating a proxy model

Scheduled Pinned Locked Moved Unsolved General and Desktop
model-view
8 Posts 2 Posters 3.1k 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.
  • K Offline
    K Offline
    KlimichKartorGnusov
    wrote on 6 May 2016, 17:44 last edited by KlimichKartorGnusov 5 Jun 2016, 17:54
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 6 May 2016, 22:05 last edited by
      #2

      Hi,

      If the source model has been implemented correctly, it should be done automatically.

      What is your use case ?

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

      K 1 Reply Last reply 7 May 2016, 05:36
      0
      • S SGaist
        6 May 2016, 22:05

        Hi,

        If the source model has been implemented correctly, it should be done automatically.

        What is your use case ?

        K Offline
        K Offline
        KlimichKartorGnusov
        wrote on 7 May 2016, 05:36 last edited by
        #3

        @SGaist For update the source model i use a signal:

        QAbstractItemModel::dataChange(const QModelIndex & topLeft, const QModelIndex & bottomRight)
        

        Necessary something else?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 7 May 2016, 19:50 last edited by
          #4

          What modification are you doing ? Through setData ?

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

          K 1 Reply Last reply 9 May 2016, 13:15
          0
          • S SGaist
            7 May 2016, 19:50

            What modification are you doing ? Through setData ?

            K Offline
            K Offline
            KlimichKartorGnusov
            wrote on 9 May 2016, 13:15 last edited by KlimichKartorGnusov 5 Sept 2016, 13:29
            #5

            @SGaist I use a custom method instead setData(). The changes are simple. Swap 1 to 0. After all is done, i emit a signal dataChange. Row which contains 1, should be in the proxy model, but is not happens. I must call the invalidate method that would update the proxy model. Why dataChange signal in source model is not enough?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 9 May 2016, 21:03 last edited by
              #6

              Without seeing your code it's pretty much Crystal Ball Debugging. Can you share the implementation of that method ?

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

              K 1 Reply Last reply 10 May 2016, 18:27
              0
              • S SGaist
                9 May 2016, 21:03

                Without seeing your code it's pretty much Crystal Ball Debugging. Can you share the implementation of that method ?

                K Offline
                K Offline
                KlimichKartorGnusov
                wrote on 10 May 2016, 18:27 last edited by KlimichKartorGnusov 5 Oct 2016, 18:32
                #7

                @SGaist Source code isn't contains mistakes. I change an object from the source data from the outside by an editor widget and for update model, i emit a signal dataChanged.
                As I understand it, after this proxy model must call protected method filterAcceptsRow for a changed row but it isn't happens. For update i must call a invalidate method, that is not good, because will be processed all row from the source model. Maybe i something don't understand?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 10 May 2016, 19:29 last edited by
                  #8

                  Like I said, without seeing any code I can't comment on whether the wrong index is being used or something else is going on.

                  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

                  1/8

                  6 May 2016, 17:44

                  • Login

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