Move functionality related to the registration of the protobuf messages
to a separate header/source files.
Task-number: QTBUG-120931
Change-Id: I6076b41139d43982148e46f5f315808509c4db65
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Make the error from the gRPC channel visible to user.
Pick-to: 6.6
Change-Id: I0c41228612beb5c1c665f79f60d14c607f5739f8
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Fixes the warning when building server and client at once.
Task-number: QTBUG-118180
Pick-to: 6.6 6.5
Change-Id: Idb52857d9d858edbecc029f3199f20fce86f40a9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Rename QGrpcStream and all related functionality to QGrpcServerStream
and corresponding names. The stream only implements server-side
streaming, and should be named accordingly.
Task-number: QTBUG-105494
Change-Id: I6b94452a447609186b1aa68ff8795293eef9dc28
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Protobuf allows the following construction:
message A {
enum AEnum {
AVal0 = 0;
}
B.BEnum val = 1;
}
message B {
enum BEnum {
BVal0 = 0;
}
A.AEnum val = 1;
}
This requires forward declaration of nested enums, that is not possible
in C++. To solve this problem we may do the same trick that we do
for nested messages already.
This patch moves the nested enum type out of class to the
_QtProtobufNested namespace. The solution require the enum name
specification when using enums from this moment, since the owning
messages only contain type aliases now. So from example above to access
the AVal0 you need to use the full qualifier:
A::AEnum::AVal0
The new generated code structure registrates Qml types using the built-in
macros, that unlocks direct linking of backing library without the need
of Qml plugin usage.
[ChangeLog][Protobuf] Nested enums moved out of message classes to the
nested namespace, same as the nested messages.
[ChangeLog][Protobuf][Qml] The geneated protobuf Qml modules do not
require the use of Qml plugins.
Fixes: QTBUG-115800
Change-Id: Ia67fcbecf492c3fd41350eada4d62fc9e5ea4dab
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
We try to print this string but it is never assigned. Lets show
the users who registered.
Pick-to: 6.6 6.5
Change-Id: I0e384a2591aae0e39c567b1ccab694bdeddee920
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
It doesn't make sense to store messages in repeated fields using
shared_ptr, especially because all protobuf messages implemented
using implicit sharing. This also allow using repeated fields from
QML without the need for extra registrations and conversion.
Task-number: QTBUG-113688
Change-Id: I0a2bf2bb79a26a1e8017cccb5d3a06b867c15c79
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Use QGrpcChannelOptions and QGrpcMetadata to set up user-password
authentication for SimpleChatEngine.
Task-number: QTBUG-111037
Change-Id: I2e7dea87d542b4f7585b0724a45c1398fa2047b5
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Introduce alias to std::multimap names QGrpcMetadata, to represent
additional HTTP headers, that can be added to channel and call options.
Then channel implementations can use QGrpcMetadata and append all
metadata do each call (TODO).
Task-number: QTBUG-111037
Change-Id: Ie16e658407a57a5f44bc1a0ff54dcb3ca8b06fe1
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Use the new classes to store call and channel options used to
create gRPC channels and perform gRPC calls.
Add QGrpcCallOptions parameter to call() and startStream() methods.
Change constructor parameter of QGrpcHttp2Channel and QGrpcChannel
to QGrpcChannelOptions that stores previous parameters used to
construct channel. Add additional deadline option to be able to
configure call timeout.
[ChangeLog] Add QGrpcCallOptions to store and process additional
call options.
[ChangeLog] Add QGrpcChannelOptions to store and process channel
options and default call options.
Task-number: QTBUG-111037
Change-Id: Icd92e95c036fb5b4c268907ab912fcf59ef9a69a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Replace the AUTORESOURCE_PREFIX argument with the explicit
RESOURCE_PREFIX.
Pick-to: 6.5
Change-Id: Iac73ba194ed1af07456dde7df9cd95fa55e5e024
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
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>
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>
If libprotobuf is not built with -fPIE enabled we cannot link it
to qtprotobufgen. Disable the flag until provisioning got the proper
update.
Do the same trick for all executables and libraries that are linked
to the libgrpc* or libproto* libraries.
TODO: Re-enable PIE once QTBUG-111485 is fixed.
Task-number: QTBUG-111485
Pick-to: 6.5
Change-Id: I8735069c0c0ab61ec5b118ee5c261f77627e3f8c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Backport the simple chat example. The application implements a simple
messenger using Qt GRPC. It shows how to utilize the server-side
streaming and use the call-based user/password credentials.
Task-number: QTBUG-109598
Pick-to: 6.5
Change-Id: I4ca3695780a9cc9991c92c4423e3af9d8e0eaf35
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>