Add warning messages when elements count exceeds INT_MAX
Since Qt 6 we use qsizetype for indexing in QList. This means that all
the APIs should be changed accordingly. However, QML still has only
an int type.
As a result, some APIs have a risk of overflowing and returning incorrect
indexes when used from QML.
In QtPositioning such classes are QGeoPath and QGeoPolygon.
Considering that in the real usecases it's very unlikely that someone
will ever add more than std::numeric_limits<int>::max() elements to the
path or polygon, this patch just adds warning messages for such cases.
As a drive-by: refactor QGeoPolygon::addHole() so that one overload of
this method calls another to avoid code duplication.
Pick-to: 6.2
Change-Id: Ib8167f729a70ec511c964ea98fa8f8400a56bb1f
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>