QGeoCoordinate: fix toString() conversion


Applying qRound() to check if the minutes/seconds should overflow was
not the right solution in some cases. It could lead to incorrect
overflows, and so - to wrong conversion results.

The actual logic of overflow is related to the behavior of QString::number.
This patch fixes the logic and also introduces some minor optimizations.
After overflow, the minutes or seconds value is always 0.0, because
the actual minutes/seconds value is always in range [0; 60). This allows
us to get rid of some checks.

Fixes: QTBUG-95221
Pick-to: 6.2 5.15
Change-Id: Ie3dcb6cef226b04c43dd973c09c4ae297c583f3b
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
commit15f06eca6a5085ce14d2eb0b743c5a06365068ea
parentf7938b238d9634e93662013750568eb86ce2a0e2
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeThu, 29 Jul 2021 12:10:55 +0200