Commit Graph

1495 Commits

Author SHA1 Message Date
Alexey Edelev b614b9dc26 Document the QT_USE_PROTOBUF_LIST_ALIASES cmake property
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>
2024-12-16 09:57:37 +01:00
Alexey Edelev 4b778a70d0 Avoid generating QList aliases for the protobuf messages
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>
2024-12-16 09:57:33 +01:00
Qt Submodule Update Bot b669d73025 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I92002246f45b65f69fc1f04c987f7c1f54954cc4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-08 17:02:27 +00:00
Qt Submodule Update Bot 59157d01d8 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Id8a224d255d0904053502e658a43c97a8c88e6cf
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-08 03:30:12 +00:00
Dennis Oberst 4410e9c7a9 Docs: Add missing doc for HEADER_GUARD option
Amends f3125dd7a3.

Task-number: QTBUG-125406
Change-Id: Id0000d8a0d1481334cd7c24df504c269dd0d046a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-12-06 18:14:35 +01:00
Dennis Oberst 995012aa82 qtprotobufgen: add QVariant operator for value-type messages
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>
2024-12-06 18:14:16 +01:00
Dennis Oberst 4a3fc66b89 generator: handle invalid identifier(s) in filename
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>
2024-12-06 18:13:44 +01:00
Dennis Oberst aa70a1099c gitignore: add qmlls.ini files
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>
2024-12-06 14:02:16 +01:00
Ulf Hermann 2da5a76d45 Use the upper-case Protobuf module name also in configure.cmake
Amends commit b6f0fdc89a

Change-Id: I20435b5cf2afd334fb31200e180dd34f4f303110
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-12-06 11:32:42 +01:00
Alexey Edelev b6f0fdc89a Use the upper-case Protobuf module name when looking it
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>
2024-12-03 16:18:57 +01:00
Qt Submodule Update Bot bfd24967bc Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Ib91330abf1264a66b253050e4e8314e081b7e29e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-03 13:50:03 +00:00
Qt Submodule Update Bot f3edd0dd0a Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Id8ff39787398a6df97b5cdaec07e059f88633473
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-02 13:50:39 +00:00
Jaime Resano 524ba1e4d0 Rework vehicle example
Improve QML UI, simplify server logic, add documentation

Task-number: QTBUG-129571
Task-number: QTBUG-128468
Pick-to: 6.8
Change-Id: I46d04a033a7301b9c98a3e03861b9212e7a2378d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jaime Resano <Jaime.RESANO-AISA@qt.io>
2024-11-29 13:53:37 +01:00
Qt Submodule Update Bot 5242c14faf Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Id9ca1d18debbadb68876f3c03cf885482b7cc8c5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-28 12:18:15 +00:00
Ulf Hermann 0707390862 Revert "Disable QML Protobuf tests in Android"
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>
2024-11-27 20:14:23 +01:00
Alexey Edelev 0f2c3c516e Add the missing initializer for the google::protobuf:Any field
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>
2024-11-27 16:34:10 +01:00
Qt Submodule Update Bot 56a67f9c67 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I9f5e51aed786ea5ba88e1cb3ea27330ca3290ec4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-26 15:29:16 +00:00
Alexey Edelev 2c6ea3fb35 Fix the testComplexField initializing in tst_repeated
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>
2024-11-26 11:36:25 +01:00
Alexey Edelev 3d01eab5ab Extend the constraints of QProtobufOneof
Ensure that QProtobufOneof can handle types like QtProtobuf::Any.
These types inherit QProtobufMessage but work differently and do
not contain the static property ordeing. They use the customized
serializer proxies instead and passed by value when accessing using
the gadget property.

Add QProtobufOneof specific constraints to ensure we cover the use
of types like QtProtobuf::Any as oneof field.

Pick-to: 6.8
Change-Id: Ib40df389cee3352803d0a85bab2229583f8e0727
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-11-21 16:16:40 +01:00
Qt Submodule Update Bot 507062ccf4 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I944b90ab992d1b7d2f021e797a7c8dc85a5e98e5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-19 16:49:03 +00:00
Jaime Resano c761459e59 Rework magic8ball example
Improve QML layout, GRPC communications, animation logic and
documentation. Simplify the GRPC server implementation removing Qt
parts.

Task-number: QTBUG-129571
Pick-to: 6.8
Change-Id: I8913ca3b52950d950dd5862bd986b222f0e6405e
Reviewed-by: Jaime Resano <Jaime.RESANO-AISA@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-11-15 14:40:21 +01:00
Jaime Resano 2683203c5d Docs: move chat grpc example documentation to suitable folder
This is the idiomatic way of providing documentation files for our
examples.

Task-number: QTBUG-129571
Pick-to: 6.8
Change-Id: I821cf955371766ef473551607308f59c6c2e692b
Reviewed-by: Jaime Resano <Jaime.RESANO-AISA@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-11-13 14:47:02 +01:00
Jaime Resano c7f646780e Remove outdated path from qtgrpc doc file
Since the documentation has been moved to the example folder, the path
is no longer valid

Task-number: QTBUG-129571
Pick-to: 6.8
Change-Id: Ia299de0801b89f98d13bbb9714e7ce597af90ac5
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-11-13 15:47:02 +02:00
Jaime Resano 4e6fa8f643 Docs: move magic8ball grpc example documentation to suitable folder
This is the idiomatic way of providing documentation files for our
examples.

Task-number: QTBUG-129571
Pick-to: 6.8
Change-Id: I3fda6a56d6de0d7378d2339bb8ca3930f06dd6ae
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-11-13 14:35:07 +02:00
Jaime Resano c0599b3840 Fix channel options test when no SSL is configured
The channel options test should not check the SSL configuration when
SSL has not been configured

Fixes: QTBUG-131134
Pick-to: 6.8
Change-Id: I6356d0e7b9330a6b5d6830da93d4bb0958f6dcf7
Reviewed-by: Jaime Resano <Jaime.RESANO-AISA@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-11-13 11:33:11 +01:00
Qt Submodule Update Bot 868615267b Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I74d48b4d6f2de05fa81e2da7842fbbe0c2690dec
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-07 05:22:57 +00:00
Lucie Gérard f5f58bb514 Add REUSE.toml files and missing licenses
REUSE.toml files are read by reuse to complement or override the
copyright and licensing information found in file.

The use of REUSE.toml files was introduced in REUSE version 3.1.0a1.
This reuse version is compatible with reuse specification
version 3.2 [1].
With this commit's files,
* The SPDX document generated by reuse spdx conforms to SPDX 2.3,
* The reuse lint command reports that the Qt project is reuse compliant.

In order to be reuse compliant all the licenses present in the
LICENSES directory must be used. License files not used are removed.

[1]: https://reuse.software/spec-3.2/

Task-number: QTBUG-124453
Task-number: QTBUG-125211
Pick-to: 6.8
Change-Id: I1d2b4f8cdd3464877eab3084a0087284c810f6ba
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-11-06 14:24:23 +01:00
Qt Submodule Update Bot d7a93315de Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I97ef808ea4ab1de825ea07f217bd387d33361d16
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-06 11:58:19 +00:00
Alexey Edelev faa7b32ebc Remove the redundant usage of Qt from SimpleVehicleServer
The example server doesn't really need to use Qt. Remove the
dependency on Qt Core.

Pick-to: 6.8
Change-Id: I8b64e9765f529baa1bcf041a801723ceaed85334
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-11-06 12:27:38 +02:00
Alexey Edelev 90334a0f6c Update the qt_internal_link_internal_platform_for_object_library usage
The function now accepts two arguments, but not one. The second argument
is the main plugin target that the object library belongs to. It's used
to keep the set of flag-controlling properties consistent between
object library and plugin.

Change-Id: I695c613a70e56bf99cf1efabc3288fb720d10e66
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-11-05 16:51:26 +02:00
Qt Submodule Update Bot d4cbd3006a Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I605cc8ba31c02cf8f6898d19c071ac9f50bab045
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-01 18:09:52 +00:00
Qt Submodule Update Bot 96c5888db0 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Ie05dc83ab0bb0c530a07a33cb228b78268cb2727
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-10-30 20:15:04 +00:00
Qt Submodule Update Bot e370635491 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I8ea3a65c026e312d99e7ef75d5fad44c190c0e74
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-10-23 03:22:05 +00:00
Alexey Edelev fa7c4410e8 Remove WrapgRPC and WrapProtobuf modules
These modules are not relevant anymore. After porting Qt::Grpc
relied on native gRPC implementation. But since we migrated to the
fully functional Qt HTTP/2 the need of reference gRPC and protobuf
gone.

Remove the WrapgRPC and WrapProtobuf modules, use the protobuf
gRPC modules directly in tests examples and tools. Since non of
those never add the build-time depdendcy on reference libraries,
we don't need to add the respective dependencies in Qt packages.

The only thing we still wrap is protoc. We either look for executable
but we never propagate it as the reference target, but utilize the
path from there.

Fixes: QTBUG-128809
Change-Id: Id5008f8dd935288cbaa8a9abb88d485824099d46
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-10-15 18:12:58 +02:00
Alexandru Croitor 383535496b CMake: Add qt_autogen_tools_initial_setup calls
Add calls to qt_autogen_tools_initial_setup to avoid
'CMake Error: AUTOMOC for target' errors.

Pick-to: 6.8
Fixes: QTBUG-129918
Change-Id: I4d120707b738edfdf37f89228434145b4b1ad75f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-10-15 08:24:49 +02:00
Dennis Oberst 746aae76b7 QGrpcOperationContext: rework documentation
Task-number: QTBUG-125406
Pick-to: 6.8
Change-Id: I69f7a6df5426261651b56850ef758c0ab9ec1409
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-10-01 21:09:27 +02:00
Alexey Edelev 032214e322 Complete qtprotobuf qtgprcgen tests refactoring
Move the common logic of two tests to the base class. Adjust the
implementation of the qtgrpcgen test to the recent changes in
the qtprotobufgen test.

Pick-to: 6.8
Task-number: QTBUG-128753
Change-Id: I946cd132c6850ce56d8c3217169bb5c4e335e969
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-10-01 18:26:24 +02:00
Alexey Edelev 7606cf36d3 Fix the shadowing of counting variable in for loops
Avoid shadowing 'i' QGrpcGenerator::GetInternalIncludes.

Pick-to: 6.8
Change-Id: I372877cba9640dcf412da62af6b7344f82c7583e
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-09-30 16:07:06 +02:00
Alexey Edelev fc773b35a1 Remove the outdated guard for protoc availability in tests
MacOS provisioning is fixed long time ago. Remove leftovers from
tests.

Pick-to: 6.8
Taks-number: QTBUG-109130
Change-Id: I4565ffecfd49ac7f6c56045027a6f564d0547e3e
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-09-30 16:06:25 +02:00
Alexey Edelev 0ae6627df9 DRY qtgrpcgen and qtprotobufgen tests
Add the protocplugintestcommon static library that contains a common
code for both tests.
Reuse the library in tests instead of code duplication.

Pick-to: 6.8
Task-number: QTBUG-128753
Change-Id: Ib56861462635d6a0fff0f1add9b2cd7765316e09
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-09-30 16:06:20 +02:00
Alexey Edelev 3f283bd729 Add the qtgrpcgen tests for HEADER_GUARD option
Add the missing tests for the HEADER_GUARD. The test was not
provided by functional change, since it required the refactoring
in qtprotobufgen test kit.

Change-Id: I1e14ba29c61adb80d5af3775c7c729f1ab508448
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-09-30 16:06:13 +02:00
Alexey Edelev ce98c06105 Refactor the qtprotobufgen test
Use the common .proto scheme for all testcases, that defined lot of
message variants, so we can see how changes in generator affect
various types but not only restricted subset.

Rearrange the test cases according to the generator options.

Change the verification process for command line tests. Consider not
only some files but all generated files, so we can see if some new
file is added or some files are remove/renamed.

Simplify tests.

Add the COPY_TEST_RESULTS environment variable support. This variable
now allows copying test results to the source directory. The introduced
functionality is very handy when need update expected results after the
major changes in generator.

Add the respective feature guards for the QProcess usage. In case if
the feature is disabled in QtCore.

Pick-to: 6.8
Task-number: QTBUG-128753
Change-Id: I5ac33684c8cf4fd5dd133b404061db4435a87344
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-09-30 16:06:05 +02:00
Alexey Edelev 95104b6ac9 Use the correct string literals when serializing (-)Infinity and NaN
Protobuf required the special strings for (-)Infinity and NaN floating
point numbers. Use the valid letter case when serializing those.

Pick-to: 6.8
Change-Id: I45a9190aee8d407eca63fd1b352d041d5063e7ec
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-09-30 12:11:37 +02:00
Alexey Edelev 11f053d77c Introduce ProtobufFieldPresenceChecker
The namespace contains the functionality that was a part of
QProtobufSerializerPrivate before. Move this functionality to a
separate file, since we want to unlink QProtobufJsonSerializer
implementation from the QProtobufSerializer one.

Pick-to: 6.8
Task-number: QTBUG-128812
Change-Id: I7b97ced9fbfa1076b2e898832575c1931923a2c3
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-09-30 12:11:34 +02:00
Alexey Edelev 4577291626 Fix the invalid handling of header files suffixes
Avoid removing and appending header files suffixes where this is not
intentional. Change the default internal header file template and
always add the suffix explicitly, where required.

Pick-to: 6.8
Change-Id: I1fff1d3813700d6387964d5411970b21ecb4a2e6
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-09-27 17:24:29 +02:00
Alexey Edelev c344407f8c Use testAnyFlags in isOneofOrOptionalField
Use QFlags::testAnyFlags instead of plain bitwise operations.

Pick-to: 6.8
Task-number: QTBUG-128812
Change-Id: I0a9723a146326e363e31948f9fb6c63185e13cac
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-09-27 15:06:13 +02:00
Alexey Edelev a9bc44e092 Add the result metatype to QGrpcOperationContext
In certain usecases users might need to know the RPC result message
type. Currently we do not store it anywhere, so API users decide
how to deserialize message when calling QGrpcOperation::read method.

Add RCP methods overloads to QGrpcClientBase that accept the meta
types of the RPC result messages. Generate the code that uses these
overloads by default, sot QGrpcClientBase can store the information
about the result type inside the QGrpcOperationContext.

Introduce QGrpcOperation::responseMetaType,
QGrpcOperationContext::responseMetaType and
QGrpcOperationContext::setResponseMetaType methods.

These methods are user-facing API to access or change the result meta
type.

Task-number: QTBUG-128743
Change-Id: Ide0ebc1c935dfbdf0d3b62e05acdf058f95bf367
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-09-27 15:06:08 +02:00
Qt Submodule Update Bot 21a3acb76a Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Ic57f5dc8228d2564263d411159943b6f7edaf3bd
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-27 06:59:39 +00:00
Qt Submodule Update Bot 5ec9ea9a28 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I96dbbdce924584df5d6dfd09c0936aeae8457a2d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-25 04:24:29 +00:00
Alexey Edelev c0713d6614 Add the missing guards for QLocalSocket usages
Guard the QLocalSocket implementation in QGrpcHttp2Channel
with the respective feature condition.

Fixes: QTBUG-129204
Pick-to: 6.8 6.8.0
Change-Id: Ie4de6576318305194735d76b46db1475faff3fdb
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2024-09-24 05:33:18 +00:00