MapItemView and resizing
-
I am using a MapItemView to render many MapPolyLines on a Map component. The model is a QAbstractModel using C++. The lines show correctly when the Map is first displayed but when the window is resized the model does not refresh unless I pan or zoom the map.
I initially thought the issue might be to do with my specific setup as I was using a Qt Widgets with a QQuickWidget for my QML. I switched to using a QQuickView but had the same problem. I also tried a pure QML application using QQmlApplicationEngine and get the same result.
Rather than posting code this issue is reproducible using the GeoJsonViewer example app. If you run the example, load a GeoJson into the viewer and then resize the window so it is larger you should see that the GeoJson isn't redrawn unless you pan or zoom the map (I am using Mac OS Sonoma with Qt 6.7.3).
I am familiar with several hacks for forcing the MapItemView to redraw the model, but this is very inefficient and my model contains thousands of lines so I would like to find a solution where the model isn't force reloaded.
Does anyone have any idea how I can achieve this? Even though my model contains thousands of lines, panning the map works silky smooth and I would like something similar for resizing.