QML option of both qt_add_protobuf and qt_add_grpc calls requires
ProtobufQuick and GrpcQuick targets to be found, accordingly.
Currently calls will fail with non-intuitive error that points to
the missing linking dependencies. Trigger a FATAL_ERROR at configure
time and give a hint on how to solve this.
Fixes: QTBUG-131780
Pick-to: 6.8 6.9
Change-Id: I571aa35839a6b68b54f5a71f0ee1947445b5eb2c
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Each 3rd party license attribution is identified by a
unique Id key, which should be all lowercase and without
spaces. See QUIP-7 for more info about the qt_attribution.json
file format: https://contribute.qt-project.org/quips/7.
Pick-to: 6.9 6.8
Change-Id: Ic06e3d8c0bf88fe51b246b98f3c8f890cdcf8e55
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Added support for encoding google::protobuf::Timestamp in the [RFC 3339]
format in JSON. The Timestamp message has seconds and nanos fields
which were serialized as is previously. After the fix, the Timestamp is
serialized in a "field-name":"2024-11-14T06:20:11.530Z" format in JSON.
Pick-to: 6.8 6.9
Fixes: QTBUG-130555
Change-Id: I7372e541faccdb7dec9083e36b673013a9a4ce5e
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Ensure that we clear the deserializer state when re-use it after
unsuccessful deresializing.
Pick-to: 6.9 6.8
Change-Id: I6e0c489706b90e8daaa49c1872642a7cbefee2e3
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
When using the nested Qt types from either QtCore or QtGui packages
protobuf generator doesn't consider these types when generating the
includes.
Fixes: QTBUG-132182
Pick-to: 6.8 6.9
Change-Id: I6f0de0119ff9f8fd8109dd621a0d20f5dca31003
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Specify the possible values explicitly and extend the description.
Amends 4410e9c7a9
Task-number: QTBUG-125406
Pick-to: 6.9
Change-Id: Ic44b22f5959555119442672a96b0b237a6bd3813
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Protoc disallows using the <field name>Entry if the respective
<field name> map field is defined. But meanwhile it allows using
<field name>_Entry as the field name, which ends up as
<field name>Entry in the generated code. The difference is in the
letter case is used for the alias we add for map entries and the
actual field name.
As the conclusion - test passes, but we should keep it in our test
suite to ensure we compliant with the protoc rules.
Pick-to: 6.8 6.9
Change-Id: I8a8d6796b6c5564b211bd11fdd23102b0031031e
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Remove the end of varint flag from uchar value already, since we don't
use the top-most integer bits when applying the mask, so this can be
done at initialization already.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: Iba15265047d7d72d63ce47ab7b8980184d9b4a4f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
To conform with the style used in other docs in Qt GRPC.
Task-number: QTBUG-125406
Pick-to: 6.9 6.8
Change-Id: Icfc62bf0c5f3a739262fafebb539a63344380f5c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This patch also adds qtgrpc-shared.qdoc - a place to shared common
documentation snippets.
Task-number: QTBUG-125406
Pick-to: 6.9 6.8
Change-Id: I31e7cd3a254f91df19c0e7b5df4cdfac770c4388
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
It contains in depth documentation to get started with Qt GRPC
and replaces the 'Client Methods of the Qt GRPC Service' guide.
This will enable users to also run the code, experiment with it and
show us the error directly in case they fail to compile.
Task-number: QTBUG-125406
Fixes: QTBUG-129588
Pick-to: 6.9 6.8
Change-Id: I8f16156a13da1683bce0e31001ee6b2ff57b1824
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
It will add the 'tm' logo to the first occurrence in the document. We
still add it to any mention of it since this will protect against
copy-paste issues when borrowing chunks of the documentation.
Task-number: QTBUG-125406
Pick-to: 6.9 6.8
Change-Id: I099633bcda78a1940c65c379328539190833d6f9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This is one of the first introductions in how to use the cmake api. Try
to start teaching the most simplest way: reusing the application target.
Pick-to: 6.9 6.8
Change-Id: I94c070bde4dec5adf33f4f244cad0ed105c4d510
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Collect .proto files in the targets that use them in generating process.
Pick-to: 6.8 6.9
Change-Id: Iaeb6f520051fabe7b188e4f758671ca0bdaa3645
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Add the benchmark of the JSON deserialzer. Re use the common
functionality in both JSON and protobuf deserializer benchmarks.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: I34befe253d076793228f660b24a9983af0fbc780
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Remove the duplicated preserveUnknownFields variable in
QProtobufSerializerImpl, use the parent pointer to acquire its
value instead.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: I8c81e5ea6565f056756703d5ca989b67d163dd19
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
When looking for non-packed deserializer we may make the lookup only
once, since we may predict the non-packed field from the wire type.
If it differs from the Length Delimited type and the field is Repeated
according to the stored meta info, we may conclude that the received
data is non-packed and use the corresponding deserializer.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: I3ead7e8b64cda26179c7b5fc9917737b41e22882
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Make 'size' static constexpr. It can be calculated compile time and
stored the binary data.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: I39abf998d2fdc825b6ffd0c0783ee9321dc338db
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
We may move the iterator forward right in condition. When checking
for the end of varint mask.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: Ib0893a80c29752176e9e300e05cd5ea007a58e0f
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
We may reuse the variable instead of instantiating the empty
QByteArray.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: I4c0b92926af6904f5003f3511f6dcf0e89c1e42f
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
The uValue variable can be intialized by real value in place. It's zero
initialization is pointless.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: I515f2f7e35c092b87c140ff95df8e4ee3a92d03a
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
All types that the function accepts, are unsigned ints.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: I3e9d07eaa6e5476a32ad889b6c8f51a3430e5a52
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Move the part that doesn't depend on template arugment to a
serializeVarintCommonImpl function. Also it makes sense to make it
out of line.
Use the impl function but not the template one when serializing
the size of length delimited fields. We trust out selves that this
type is compatible with serializeVarintCommon.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: Ifcda7ebf7b2dee209c258d64724908022cf66de9
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Add the upper and lower case protobuf package names explicitly and keep
the protobuf package lower case for the variables consistency.
Pick-to: 6.9
Change-Id: Id8acf1d986e0274f99587d554e5dc5308f15a31d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Move the scalar type serializers to a separated translation units. This
make code more readable. Adjust constraints to follow common project
coding standards and make constrains compilation faster. Make complex
functions out-of-line to avoid unwanted binary expansion.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: Ib5311f392e32e5f31416448d2f306ae91155f873
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Move the generic logic of serializer to a separate class and
use this class to implement the protobuf and JSON deserialization.
This also fixed one of the conformance usecases since related
to invalid enum handling.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Fixes: QTBUG-112423
Fixes: QTBUG-112425
Fixes: QTBUG-112424
Change-Id: I400303a8666df90050a54bd7036daa0107adcce5
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Move the generic logic of serializer to a separate class and
use this class to implement the protobuf and JSON serialization.
This also fixed one of the conformance usecases since related
to invalid enum handling.
Pick-to: 6.8 6.9
Task-number: QTBUG-128812
Change-Id: Ie78da9103e68e7701b36f7d4e4c8e83f38d3c5c2
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Use more complicated data structure when benchmarking the protobuf
deserialzer. This allows also to identify changes that have
performance impact onto the deserialization.
Pick-to: 6.8 6.9
Change-Id: Ibf3a312c18edb86d383d5e236f3dad47e8581532
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>