Fix fromJsonValue(value, jval) for Integer Types


- The previous implementation attempted to convert a QJsonValue(jval)
to an integer even when it contained a string or a non-integer double.
It also returned true in these cases, which is entirely incorrect.

This behaviour is wrong because:
1. The result of converting "blabla" to an integer should never be true.
2. Strings should not be interpreted as integers.
OpenAPI 3.1 uses JSON Schema, which enforces strict type validation.
A value of type number is not valid for a schema with type: string,
and no implicit conversion is allowed.
3. Doubles with fractional parts should not be treated as integers.
JSON Schema 'defines integers mathematically':
https://spec.openapis.org/oas/v3.1.1.html#data-types

Here and in follow-up commits, I rely on the idea that by default
the generator should enforce strict type validation, similar to how
JSON Schema does.
Soft validation that silently fixes input data gives users a false
sense of correctness and leads to problems being ignored.
But we can provide the generation option, that will allow switching
back to soft data validation. I created the task here: QTBUG-145466

The current error is a combination of an actual error and soft
validation:
an attempt to convert "blabla" to an integer returns 0 because
the conversion is not possible, but at the same time, fromJsonValue()
returns true, indicating that the conversion was successful.

Correct Behavior:
* The method must return false if jval is a string or a non-integer
double.
* It must not attempt any conversion in these cases.

Limitation: QJsonValue does not provide an isInt() method.

Updated Approach: Since integers are represented as doubles in
QJsonValue (isDouble() returns true), we can:
* Check if jval.isDouble() is true
* Ensure the value has no fractional part
* Verify it is within the valid integer range

Task-number: QTBUG-145410
Pick-to: 6.11
Change-Id: I472c9f32943526f63d16d07a9e1404a508234ac5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
commited8d2f5b5d9500d14fb3494714fa50c6498ba045
parent414e5e8c955edb7a8d62133ab6ba2e5646b85322
authorTatiana Borisova <tatiana.borisova@qt.io>
committerTatiana Borisova <tatiana.borisova@qt.io>
commit timeTue, 7 Apr 2026 15:20:46 +0200