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>
commitdf0a13aa2aaa3e04dbf387b3a1a5f75436871670
parent8d36af45b0de8fdc686871a2a818f72ad0a6a28e
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeFri, 12 Dec 2025 10:09:59 +0100