QJsonRPC: Force IdType construction from QJsonValue


Make IdType a class with a QJsonValue constructor, so that users of that
type don't have to parse QJsonValue into an id by themselves.

Forbid the manual creation of IdType from an int or a string by making
the constructor taking a std::variant private.

Move the toString() method into that class, and adapt all usages.

Pick-to: 6.12
Fixes: QTBUG-148487
Change-Id: Ibefc5db7c9f97c8d1c85735d76ddb6caa60909ca
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
commit8ef06009e4f33ac45ef6f1a6e4f16656a213c2f3
parent31a3d922a849b8bc20321d0a3500ce034e5edbff
authorSami Shalayel <sami.shalayel@qt.io>
committerSami Shalayel <sami.shalayel@qt.io>
commit timeThu, 30 Jul 2026 07:58:03 +0000