@j_omega said in Most efficient way to approach lots of polygons in QML/C++?:
What are the big drawback to switching to QGraphicsView at this point?
Well, the code rewriting might be a drawback of course :-) QGraphicsView is based on widgets, not QML so it will require changes in the UI code. It also lacks some QML features like shader support, graphical effects etc.
But it offers a lot when it comes to fine tuning the performance, and excellent support for custom shapes.
Perhaps a good idea would be to wrtie a small test project/ benchmark with QGraphicsView, it will allow you to compare ease of maintenance, performance etc. of both solutions.
Also, going back to your original question:
What design changes can I make to make this run smoother?
Here are a few general ideas on how to (potentially... I recommend checking with some benchmark) improve the performance. Some may not apply to your app:
make sure you only paint and keep in memory items which are visible on the screen - invisible parts of the map should be clipped
use lazy initialization - only load part of the scene initially, then continue loading more items only if needed
check out the QNanoPainter and other hints from the articles I linked before
use caching - this is potentially the biggest gain. For example, only paint your QPolygons in a single item once and store the result in an image. Then, when QML engine wants to paint the item, provide the image from cache instead of recalculating and repainting the whole QPainterPath
try to reuse components as much as possible - it looks like a lot of them are really similar so if the cache mentioned above can be shared between items, you could see even better results
if you use SVG images anywhere - don't :-) Rendering SVG is very slow
read through the official guidelines for QML performance http://doc.qt.io/qt-5/qtquick-performance.html
don't use QML Shape components - they are great but slow :-)
see if you can port some of the items to use shaders for example, so that they are painted by your GPU instead of CPU
try to minimize the load on QML engine - less bindings, more C++ (than JS), less timers and animations