Split from https://github.com/bitcoin/bitcoin/pull/30997.
QLocale::nativeCountryName()
has been deprecated since Qt 6.6.
QLocale::nativeTerritoryName()
was introduced in Qt 6.2.
This PR ensures compatibility across all supported Qt versions.
No behaviour change for the current codebase, which uses Qt 5.
This PR can be tested on macOS using the first commit from https://github.com/bitcoin/bitcoin/pull/30997 and Homebrew’s qt
package.