Unsolved Is VBarModelMapper supposed to update the chart for me?
-
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
-
Does anyone think I should file a bug report about this?
-
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.
-
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.
-
My bad, you're right. I remembered wrongly the documentation of the function (always better to double check...)
-
I submitted a bug report, so maybe we'll hear back from the Qt team telling us if this is expected behaviour.
-
Can you share the report link please ? That will make it easier to find.
-