Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Is VBarModelMapper supposed to update the chart for me?
Forum Updated to NodeBB v4.3 + New Features

Is VBarModelMapper supposed to update the chart for me?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 2 Posters 1.7k Views 2 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.
  • S Offline
    S Offline
    StoatPatronus
    wrote on last edited by
    #1

    I didn't find any search results for VBarModelMapper and HBarModelMapper on the forums, so this might be a tricky problem.

    I'm using a QAbstractListModel-derived class to provide data to a QML ListView and Chart. Whenever I add data to my model, the ListView is updated correctly with the new rows. But when I use VBarModelMapper, the chart only shows the initial data, not the data I added later.

    According to https://code.woboq.org/qt5/qtcharts/src/charts/barchart/qbarmodelmapper.cpp.html it looks like the VBarModelMapper handles the rowsInserted signal, but my chart never changes on the screen.

    I made a simple version that shows my problem, it's on https://bitbucket.org/johnwoltman/chartmodelmappertest and a GIF of what I'm experiencing is at https://imgur.com/a/YKaY4

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

      Does anyone think I should file a bug report about this?

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

        Hi,

        Isn't your beginInsertRows call wrong ? You start and end at the same point which looks strange. Note it's just from a cursory look, I haven't tested your code.

        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
        • S Offline
          S Offline
          StoatPatronus
          wrote on last edited by
          #4

          I don't believe so, but I could be misreading the documentation. The way I think my code uses beginInsertRows is to insert a single row at the very end of the list.

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

            My bad, you're right. I remembered wrongly the documentation of the function (always better to double check...)

            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
            • S Offline
              S Offline
              StoatPatronus
              wrote on last edited by
              #6

              I submitted a bug report, so maybe we'll hear back from the Qt team telling us if this is expected behaviour.

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

                Can you share the report link please ? That will make it easier to find.

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

                S 1 Reply Last reply
                0
                • SGaistS SGaist

                  Can you share the report link please ? That will make it easier to find.

                  S Offline
                  S Offline
                  StoatPatronus
                  wrote on last edited by
                  #8

                  @SGaist https://bugreports.qt.io/browse/QTBUG-60336

                  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