Add fromByteArray() helpers for primitive types
... and use them in the operation callback code, where
constructing an intermediate QString really seems unnecessary for
most of the possible types.
In some cases (e.g. date and time classes) there's no optimal path
for QByteArray input, so the implementation actually falls back
to the QString version.
This patch does not touch the enum/object-model hierarchy, so
their implementation also unconditionally converts the input
to QString. It requires some more investigation to see if it can
be changed or not.
It seems that most of the fromStringValue() helpers are now unused
or only used as implementation detail of the newly introduced
fromByteArray() methods. However, let's keep them for now, because
they might be needed later when improving the response handling.
Fixes: QTBUG-137429
Change-Id: Ibcbe47c1e6f7e06e181056adadb98f50e01d2cfa
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
| commit | c90fc5bb620c8005394b22e0e09d32aed71b668b |
| parent | da9b394fa5cc69d7cfa0b4b28858160724d9b44a |
| author | Ivan Solovev <ivan.solovev@qt.io> |
| committer | Ivan Solovev <ivan.solovev@qt.io> |
| commit time | Tue, 2 Sep 2025 16:45:59 +0200 |
- M src/main/resources/cpp-qt6-client/api-body.mustache
- M src/main/resources/cpp-qt6-client/helpers-body.mustache
- M src/main/resources/cpp-qt6-client/helpers-header.mustache
- M tests/auto/colorpalette/client/client/QtOAIHelpers.cpp
- M tests/auto/colorpalette/client/client/QtOAIHelpers.h
- M tests/auto/colorpalette/qmlclient/client/OAIHelpers.cpp
- M tests/auto/colorpalette/qmlclient/client/OAIHelpers.h
- M tests/auto/mediatype/client/client/QtOAIHelpers.cpp
- M tests/auto/mediatype/client/client/QtOAIHelpers.h
- M tests/auto/mediatype/client/client/QtOAITestApi.cpp
- M tests/auto/openapi2.0/client/client/QtOAIFakeApi.cpp
- M tests/auto/openapi2.0/client/client/QtOAIHelpers.cpp
- M tests/auto/openapi2.0/client/client/QtOAIHelpers.h
- M tests/auto/operation-parameters/client/client/QtOAIHelpers.cpp
- M tests/auto/operation-parameters/client/client/QtOAIHelpers.h
- M tests/auto/operation-parameters/client/client/QtOAITestApi.cpp
- M tests/auto/petstore/client/client/QtOAIHelpers.cpp
- M tests/auto/petstore/client/client/QtOAIHelpers.h
- M tests/auto/petstore/client/client/QtOAIPetApi.cpp
- M tests/auto/petstore/client/client/QtOAIUserApi.cpp
- M tests/auto/petstore/qmlclient/client/OAIHelpers.cpp
- M tests/auto/petstore/qmlclient/client/OAIHelpers.h
- M tests/auto/petstore/qmlclient/client/OAIPetApi.cpp
- M tests/auto/petstore/qmlclient/client/OAIUserApi.cpp