Rework BaseApi::setServerIndex() method
* Rename it to setServer().
The "index" part is not relevant in the function name.
* Use qsizetype instead of int, because the server configurations
are stored in a QList.
* Update m_serverIndices map to also use qsizetype.
* Rework the implementation:
- only use m_serverConfigs when validating the input parameters,
no need to check m_serverIndices at that point;
- add a check for a negative index.
* Update the README file.
Add tests.
Found in API review.
Task-number: QTBUG-142269
Pick-to: 6.11
Change-Id: Id2056bd288aa5c9af52151d61fabe69ec999b73d
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>