Helpers: improve {to,from}{String,Json}Value() methods


For overloads taking QMap as an input:
- use asKeyValueRange() to iterate through the items instead of
  generating a temporary list of keys and then doing lookup via
  QMap::value(). The operation is available since Qt 6.4, so
  should be fine to use.

For overloads that populate QList:
- use an rvalue overload of push_back() to avoid unnecessary
  copies.

Use size() instead of count() everywhere for consistency.
Drop the curly braces when the body of the loop/condition contains
only one line.

Change-Id: Ib5abd80242e537c98d3eae89d12af78f7fa6459e
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
commit09bf1d0797a451bb4f76798cfc60c6316ce12239
parent7f27b71d23d5aa90ac07352ab43f4cc78e64dd51
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeTue, 5 Aug 2025 15:15:42 +0200