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>
Add documentation for the QT_USE_PROTOBUF_LIST_ALIASES cmake property.
The property controls the \c QT_USE_PROTOBUF_LIST_ALIASES definition,
which enables/disables the type aliases for the QLists of protobuf
messages.
Task-number: QTBUG-129652
Pick-to: 6.9
Change-Id: Ib4feb4e641386f0bfce61ab9ed06709c019ab1f0
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Generating the aliases for protobuf QList types leads to the name
clashing when users want ot introduce messages that have name
consisting of previously defined message name and Repeated suffix,
e.g.:
message MyMessage {
}
message MyMessageRepeated {
}
We shouldn't prohibit the above scheme in our generators and generate
the respective messages correctly. The only possible solution -
complete removal of the protobuf messages QList aliases.
Generator still generates the aliases guarded by the
QT_USE_PROTOBUF_LIST_ALIASES macro. The macro is enabled by
Qt::Protobuf when building using CMake, but can be disabled at any
time by setting QT_USE_PROTOBUF_LIST_ALIASES property on protobuf
target to avoid name clashing.
[ChangeLog][Protobuf] qtprotobufgen doesn't generate protobuf message
QList aliases. All usages of aliases should be replace by respective
QList types. Aliases are still generated and are guarded by the
QT_USE_PROTOBUF_LIST_ALIASES macro in the generated code. The macro
is enabled by default and can be disabled using
QT_USE_PROTOBUF_LIST_ALIASES target property.
Fixes: QTBUG-129652
Pick-to: 6.8 6.9
Change-Id: I026755b36985eef01a6851156d9c9cfff141d247
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Value type classes in Qt usually contain an implicit QVariant opeartor.
Add it to comply with idiomatic Qt patterns.
Task-number: QTBUG-129161
Change-Id: Ib9ccd0cdfa7d6d6c2440323d1cc9b6088ea554c6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The generation was broken for proto filenames, which where
invalid identifier, since the filename is used at several places in the
generation process.
This became evident for the protobuftyperegistrations and traditional
filename header guards.
Solve this by transforming the basename into a valid identifier.
Also add a testcase on the highest point of abstraction for the
generators (qtgrpcgen).
Fixes: QTBUG-131417
Pick-to: 6.8
Change-Id: I492907881913f8b43ebf365a9e1fe38062113c3c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
These files are autogenerated in the source directory when enabling
QT_QML_GENERATE_QMLLS_INI
Pick-to: 6.8.1 6.8
Change-Id: Iaa136e91b9a7d9c4d4ed881285a35967881153f5
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This will work around the issue in debian-like platforms, where
relatively new protobuf doesn't deliver the proper config files.
The lookup still prefers looking for the config files, but not
the deprecated CMake module.
Change-Id: Ie1d5217e9023022976dd058be9dd7fd1ce37e39f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This reverts commit 3d6c2827a0.
Disabling the tests was a temporary measure taken to buy us time to fix
the underlying issues. Since commit
80c6d3c08b593471f3279f45c54fdd85222072eb in qtdeclarative the particular
code exercised by these tests is fixed. Therefore, we can re-enable
them.
Pick-to: 6.8
Task-number: QTBUG-127174
Change-Id: I304dc0318be50cdf2fded34bd33d9e3ba568089c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Use the empty initialization for the google::protobuf:Any when it's
used as the oneof field.
Fixes: QTBUG-131415
Pick-to: 6.8
Change-Id: Ib2e9d9234b9cf90dce3c72b85001fa1b62a501e8
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Fix the invalid assignment of the string to an object. Assing
string values to the inner message field instead.
Pick-to: 6.8
Fixes: QTBUG-131577
Change-Id: I52dd735c0ffd3a00ac5f95f090c03b7ca3172081
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>