Commit Graph

193 Commits

Author SHA1 Message Date
Konrad Kujawa ae2f22dce2 Generate enum for each Oneof field in the .proto message
Generate separate from the QtProtobufFieldEnum enum for each Oneof field.
Use that enum in the Oneof field number getter.
Fix formatting in protobuf generator code.

Fixes: QTBUG-109126
Change-Id: Ib889a499b9abdc39ea7416cea008d157881a15fc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-04-03 13:28:05 +02:00
Konrad Kujawa f674a912b1 Add qtprotobufgen Oneof generator tests
Change-Id: I0982492014a668897ea81ab5a7d13a070b88f144
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-30 13:53:19 +02:00
Alexey Edelev b2f65ad936 Iterate over QHash using key-value range when serializing maps
Use key-value range when interating over QHash.

Pick-to: 6.5
Change-Id: Ibb4e3aae170184bda1d8d1ec1e058eb8cf396ec4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-29 16:26:25 +02:00
Alexey Edelev 00817ac4c7 Fix the deserialization of non-packed lists
This fixes the situation when we received the non-packed repeated field
from the wire, but the used protobuf schema specifies the field as
packed. This situation is possible if the protobuf schema mismatches on
on the wire ends. The explicit indication of this situation is the
wiretype mismatch. So if the wiretype differs of the expected one that
means we need to look for the handler with the 'packed' option opposite
to the one is expected by the actual protobuf schema.

Pick-to: 6.5
Change-Id: I57bf613410c4031f638533f092fd8d36c592db32
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-29 15:57:51 +02:00
Alexey Edelev e3d25d5a0b Remove redundant check for nullptr for map message values
The nullptr check is done in property serializer function, skipping
the map value of null before attempt to produce the map pair leads
to the missing map entry after serializing.

Pick-to: 6.5
Change-Id: I6d5e9884b8fda7a7e81cfd99e885564d41aea8ff
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-03-29 15:22:40 +02:00
Alexey Edelev 35fb115ecb Add recursive message test
Test for the recursive message support. Check that recurisve messages
can be compiled and serialized/deserialized correctly.

Change-Id: I34e8f60d6e64416a1665742b716356270f7ed085
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-29 15:22:36 +02:00
Alexey Edelev 39e7773160 Cleanup protobuf serializer
The actual protobuf serializer has multiple overheads and code
duplicaiton. Serialization functions use individual ways to
detect if field was initialized or not. This patch adds the
general functions that detect if field was initialized or not.

Also serializers previously juggled the protobuf field number to
conclude the need of field header. Now the header is added under
clear conditions.

For STRING and BYTES lists we should use the same way of
serializing/deserialing as for non-packed lists, since they are
non-packed lists.

Map elements should be serialized even if value is not initialized.
But non-initialized keys should still be present in serialization
stream. Avoid using serializeProperty when serializing the map key
and use integated type serilizers directly.

Pick-to: 6.5
Change-Id: I32b512acdaa9f355eea9c41f735bc9722bed0bba
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-29 15:22:32 +02:00
Topi Reinio 5249e95b3a Doc: Use \relates for functions in the global scope
This addresses the recent warnings introduced by a change to QDoc:

qtprotobuftypes.h:234: (qdoc) warning: No documentation generated for
    function 'qRegisterProtobufTypes' in global scope.
qprotobufserializer.h:319: (qdoc) warning: No documentation generated
    for function 'qRegisterProtobufType' in global scope.
qprotobufserializer.h:333: (qdoc) warning: No documentation generated
    for function 'qRegisterProtobufMapType' in global scope.
qprotobufserializer.h:361: (qdoc) warning: No documentation generated
    for function 'qRegisterProtobufEnumType' in global scope.

Pick-to: 6.5
Change-Id: I694b4a524a31c477bb3e4b52ea89b0c4823c0430
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-29 09:06:24 +00:00
Qt Submodule Update Bot 096a630cdf Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I1aa62caafadc44a1cada1a7bd8ced97003b3abfd
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-03-28 17:33:21 +00:00
Tatiana Borisova db7c8c18e9 [protobufqtguitypes library] Add Support of QColor types
Add QColor implementation for QtGui.proto

Task-number: QTBUG-109658
Change-Id: I439a00a86a1a86302fd65fe6bd55c146f010b428
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-28 19:33:21 +02:00
Konrad Kujawa 6cd79d25d3 Make IntTypes parameter a template parater in protobuf serialization data
Pick-to: 6.5
Change-Id: Ifce791a41909b8737fffd457938ae34593bd4ad2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-28 16:24:07 +01:00
Konrad Kujawa d241085ef7 Refactor tst_protobuf_deserialization_basictypes tests
Use common serialization data for serialization and deserialization
of basic types.

Task-number: QTBUG-111070
Pick-to: 6.5
Change-Id: I2691e50d570a4a7b357f1e1eaea486f606b71bbe
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-28 16:24:07 +01:00
Konrad Kujawa cd82ae8cff Refactor tst_protobuf_serialization_basictypes tests
Refactor tst_protobuf_serialization_basictypes tests to use _data()
methods and extract common data to free functions.

Pick-to: 6.5
Change-Id: I5f42a4056e438501cc6c7bf93a0dc4097845f37c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-28 16:24:07 +01:00
Tatiana Borisova 3ce9d8fd42 Add status check for deserialize operation API in QProtobufObject
Change-Id: Icd4d7e463a40c21d48030046442af44c7a89c6a6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-28 15:04:46 +01:00
Matti Paaso 5b38892268 Add Axivion config
Task-number: QTQAINFRA-5244
Change-Id: I26a75a7d4a037fea08433474e4ef28c140d32247
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
2023-03-23 07:22:41 +00:00
Topi Reinio 5a6e9f5846 Doc: Protobuf Core/Gui types: Fix .qhp file naming
The build system expects to find a .qhp file with the same base name
as the project .qdocconf file.

Change-Id: I1d60124efecd26282f198aa3cdb9d1c34b5ac7cd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-22 11:37:14 +00:00
Topi Reinio 0234024351 Doc: Add \relates command to QGrpcCredentialMap type alias
Without it, the documentation for the alias does not appear
anywhere as a type alias must be associated with something
that generates an output page.

Pick-to: 6.5
Change-Id: I5485e31ea75ca6154767531b926e1fba84ba3cd8
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-21 18:34:35 +00:00
Alexandru Croitor 9b0eb4c95a CMake: Fix commands not being available when cross-building examples
There were a few iterations of trying to ensure that protobuf and grpc
tools are available when cross-building Qt itself, but do not fail
configuration of a cross-built Qt if the host tools are not present.

The latest iteration ensured that worked fine when it built Qt itself,
but it did not account for still finding tools when cross-building
user projects (iOS / Android).

That was meant to be done by calling qt_internal_add_tool() ->
qt_internal_find_tool(), but the latter exits early if the tool is
already found, which is the case for qtgrpc because it explicitly
looks for tools in the src/tools/host sub-project, and thus
qt_internal_append_known_modules_with_tools is never called and a
dependency on the Tools package is not written into the iOS version
of the Qt6ProtobufDependencies.cmake file.

Until qt_internal_find_tool() learns to deal with that, we can
register a dependency on the Tools package manually by using
qt_record_extra_qt_main_tools_package_dependency() similar to how we
do it in qtwayland.
We only register the dependency if we the tools are not being built in
the current build (which implies a cross-build and that the
tools are already found).

Amends 0ae19cc745
Amends 39f2a1e64a

Fixes: QTBUG-111983
Change-Id: I2c37b89fd960aa142b8c4a5f150ad2067501f78c
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 07db4d5599)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-03-20 19:36:01 +00:00
Konrad Kujawa 70033adc96 Add missing handling of MODULE_LIBRARY in qt6_add_grpc() CMake method
Handle MODULE_LIBRARY target type in the qt6_add_grpc() CMake method.
The same behavior exists in the qt6_add_protobuf() and it seems missing
int the GRPC counterpart.
It fixed calls to the method in the Android environment, for example
building GRPC examples.

Pick-to: 6.5 6.5.0
Change-Id: I947587f8942dcfcced62029e39b3385e842d7933
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-20 12:20:19 +01:00
Qt Submodule Update Bot 12b284659f Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I5b292d6fa99c7597cf04d350e36537141518432e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-03-20 00:05:50 +00:00
Tatiana Borisova cd58cbee45 qtprotobufgen/qtgrpcgen: Fix code-style infractions
Task-number: QTBUG-110491
Change-Id: I208dba1d2a3bcfeaaabc861c5a335351c55a715a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-17 15:00:24 +01:00
Tatiana Borisova fa202dd944 Test code is should be updated according the latest generator version
Add protobufgen output files to the grpcgen test for auto checking
them up to date

Pick-to: 6.5
Change-Id: Ia7c3fcedfc9b3a4f0e66e748db8d5d818b4fb069
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-16 13:25:48 +00:00
Konrad Kujawa b0fbb0beb5 Return std::shared_ptr<QGrpcStream> from startStream()
Instead of the output parameter, use the return parameter
to return shared pointer to the started stream.
Remove the mechanism for reusing already started streams,
which is not specified by gRPC standard.
Removing it provides better isolation between individual
streams and simplifies the logic in the QAbstractGrpcClient.

Task-number: QTBUG-108833
Change-Id: I5c0aece8ff9c3774352c87309b1f9e7b7f62097b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-16 13:19:12 +01:00
Tatiana Borisova 8ff4b510f2 Update a few invalid links
Pick-to: 6.5 6.5.0
Change-Id: Id2dcf9b15a79a2a4cdf3e82f99b87f192a1dabcb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-15 18:51:12 +00:00
Konrad Kujawa a59d5ad763 Fix documentation issues in QAbsractGrpcChannel
Fix documentation regarding returned QGrpcCallReply.

Task-number: QTBUG-103235
Pick-to: 6.5 6.5.0
Change-Id: Iaa52352de3942c08ea679e833ebca50fecddccfe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-15 19:51:12 +01:00
Tatiana Borisova 24a3216dfb Update Qt GRPC documentation
* Split descriptions into Overview and Usage parts
* Add qt_add_grpc procedure page
* Add qtgrpcgen page
* Move qgrpc example into qdoc include header file
* Enable examples

Task-number: QTBUG-103235
Pick-to: 6.5 6.5.0
Change-Id: Ia2810e93ec2cf673c249f33ded101018259f06f2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-03-15 19:51:12 +01:00
Tatiana Borisova 87435d94c3 Provide general overview and class documentation for Protobuf module
Fix amends from e8f6a26cb2636373068e187fbb4ee7211f238289

Task-number: QTBUG-110896
Pick-to: 6.5 6.5.0
Change-Id: I2bd88e9539c91e2289617175a80a996b0b495bf2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-15 15:24:14 +01:00
Konrad Kujawa 8d44cb36bd Remove url.examples key from QtGRPC and QtProtobuf .qdocconf files
Remove url.examples key from QtGRPC and QtProtobuf .qdocconf files,
because qtgrpc repository doesn't exist in code.qt.io/cgit/qt.
This patch can be reverted once the qtgrpc.git is available there.

Pick-to: 6.5 6.5.0
Change-Id: Ifa77a42373cd03c2faf6fc36e9b494e0af87a431
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-15 13:20:47 +01:00
Konrad Kujawa 147d8a606d Fix links to CMake commands in magic 8 ball documentation
Pick-to: 6.5 6.5.0
Change-Id: I7071cfaabdd0983ff584d8b043cbf3f409fd8784
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-03-15 12:08:35 +01:00
Konrad Kujawa baae5ec639 Add missing documentation of QAbstractGrpcChannel
Task-number: QTBUG-103235
Pick-to: 6.5 6.5.0
Change-Id: I4b8cb9c4a903183233b41841984a4a8d45468d87
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-15 08:56:24 +01:00
Tatiana Borisova 2ed9177f22 Add Qt Core and Qt Gui types as documented protobuf modules
Change-Id: I40225ddbb082babf109a4fafb4bf700bcc3acf30
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-14 23:16:34 +01:00
Konrad Kujawa 9bc8f327bb Make QAbstractGrpcClient documentation public
QtGRPC generated client classes are base of QAbstractGrpcClient,
thus users of those classes should have access to documentation.
Remove \internal commands from documentation in QAbstractGrpcClient.
Update formating of \fn command parameters.

Task-number: QTBUG-103235
Pick-to: 6.5 6.5.0
Change-Id: I6654a0f5d47e4e6a7341fff779fadc8517e93cec
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-14 12:52:56 +01:00
Konrad Kujawa 04861d217d Fix qdoc warnings with missing module header files
Fix qdoc warnings with missing module header, for example QtGrpcDoc,
by removing moduleheader variable from the .qdocconf files.
Initially that was resolving issues when building documentation on macOS.
Fix the root cause of the problem by changing capitalization of the project
from QtGRPC, to QtGrpc (inspired by the QtNfc module).

Pick-to: 6.5
Change-Id: I3b9cc408235b191bbf1350a18bdd91ae45327e41
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-13 16:45:07 +01:00
Qt Submodule Update Bot 58c87e1afc Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I280b0d7ad19b07b2e0bd0efe9fa55e3b18f9f8dc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-03-11 04:07:31 +00:00
Alexey Edelev c2eabf1726 Add the missing qRegisterProtobufTypes call to tests
qRegisterProtobufTypes needs to be called explicitly if test never
uses methods that call qRegisterProtobufTypes implicitly.

Pick-to: 6.5
Change-Id: I98552ed6ca364a7620c69d4fdd3d84a635d318c0
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-10 22:12:36 +01:00
Jaishree Vyas 34ff80cfbd Documentation for Protobuf
Added Qt Protobuf overview, API description
Fixed tiny mistakes in existing protobuf docs
Updated grpc main page structure

Task-number: QTBUG-110896
Pick-to: 6.5 6.5.0
Change-Id: I61a16c5ca5adb9a5f494562a12dcf6c71a31111c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-10 17:49:13 +00:00
Alexey Edelev 575245cf3a Add support for the enum types to protobuf oneof
Enumerators are classified as 32-bit integers and should be supported
by oneof too.

Amends 2e3fdd5c05

Change-Id: I71a0d5d6aff4e6bd7a76952c2b4d2ffa1f1b9174
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-10 15:23:19 +01:00
Tatiana Borisova 4c3be32041 All convert functions should be static in qtprotobufqttypes libraries
Amends 451be2b41f170cbfe9b7a3e3eb7ba9af18c9e492

Change-Id: I1f63c9753f139d1d8bd7c1095c2af45c25ad1103
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-10 11:23:23 +01:00
Tatiana Borisova 3c0d14b915 Extend QImage converstion with TIFF case
If TIFF format is available and the image is in floating point format,
then save the image as a TIFF. Otherwise, save the png.

Fixes: QTBUG-110897
Change-Id: Id4122dcc8f7555bd51607d2a4f21c798eac2cfc4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-09 14:29:37 +01:00
Kai Köhne 28153c2540 Do not mark signal as const
See
  https://github.com/KDE/clazy/blob/master/docs/checks/README-const-signal-or-slot.md

Pick-to: 6.5 6.5.0
Change-Id: I1e43e46ecf005c6db0987cb2b58f0e31bba3a7ce
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-09 14:29:37 +01:00
Kai Köhne b8bd2b42d8 Make sure to use emit/Q_EMIT for all signal emissions
See https://github.com/KDE/clazy/blob/master/docs/checks/README-incorrect-emit.md

Pick-to: 6.5
Change-Id: Id043ef85c223fd4a723f94728c6b19f8977bdc44
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-09 14:29:37 +01:00
Konrad Kujawa 4560309429 Split tst_protobuf_serialization_maptypes tests
Split tst_protobuf_serialization_maptypes into
tst_protobuf_serialization_maptypes and
tst_protobuf_serialization_complex_maptypes.
Fix formatting in those tests.

Task-number: QTBUG-111070
Pick-to: 6.5
Change-Id: I7add0a9eab4503fe87d746ceaddec062d8993603
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-09 14:29:37 +01:00
Konrad Kujawa b9471e21c1 Split tst_protobuf_deserialization_maptypes tests
Split tst_protobuf_deserialization_maptypes into
tst_protobuf_deserialization_maptypes and
tst_protobuf_deserialization_complex_types.
Fix formatting in those tests.

Task-number: QTBUG-111070
Pick-to: 6.5
Change-Id: I8cfddb985231891aeca3e6d2bc28d87261107397
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-09 14:29:37 +01:00
Alexey Edelev 1e07202376 Revert "Disable -fPIE for the qtgrpc/qtprotobuf executables"
This reverts commit 272957831e.

Reason for revert: This can be re-enabled since we enabled PIC/PIE in provisioning.

Change-Id: I181ab2b258c0751f8379877584dac03772601240
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-09 08:32:38 +00:00
Alexey Edelev 795b4c1d16 Exclude QByteArray and QString in the check of repeated fields
QByteArray and QString have the LengthDelimited wiretype, but they
should not be handled as the repeated fields. Exclude them in
isRepeatedField check.

Amends 2e3fdd5c05

Change-Id: If683afe3d16fd7ce039e6c7443a76386e7a0fced
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-07 17:45:43 +01:00
Alexey Edelev 3ebee7b8d5 Avoid looking for protoc as a part of protobuf package when crosscompiling
Look for protoc as a program-only when crosscompiling. This avoids
exposing host protobuf libraries to CMake, when looking for host tools.

Pick-to: 6.5 6.5.0
Change-Id: I622a21d422989b4f00a399fad56f4832dc99c536
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-07 16:57:36 +01:00
Alexey Edelev 4502bb0e76 Require c++17 for grpcchat server
The example server uses the c++17 standard but doesn't require it in
CMake. Add the missing requirement.

Amends fdd1d0339f

Pick-to: 6.5
Change-Id: I84f10ec22198cb50a8f393036382021ad5bf39e0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2023-03-07 11:52:58 +01:00
Alexey Edelev 3cacc28beb Force invalidating unknown length-delimited field
If we were unable to read the unknown length-delimited field size we
need to invalidate the further deserializing procedure, since the buffer
is malformed.

Pick-to: 6.5 6.5.0
Change-Id: I6bbc3ed99b8390435aefbee15eefa3dc6a3a2ce9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-06 13:07:29 +00:00
Alexey Edelev 1c06cea7f4 Do not initialize the message fields when accessing the private getter
When accessing the message field using the private getter we do not
initialize the field. This will avoid serializing uninitialized messages
and unlock recursive message support.

Pick-to: 6.5 6.5.0
Change-Id: I84805952835f071284a55b4f049dfcbb0e27c129
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-06 13:40:50 +01:00
Alexey Edelev 872f651b77 Avoid serializing uninitialized fixed-size fields
All fixed-size fields should not be serialized to the wire if they
are uninitialized(the value is '0'-like).

Amends df8e7e1b8d

Pick-to: 6.5 6.5.0
Change-Id: Iba6b4f742e08ccd204233fcc1fd1cd04a5394032
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-06 13:40:42 +01:00