Commit Graph

47 Commits

Author SHA1 Message Date
Alexey Edelev 252c5467de Add the hint to find the host grpc_cpp_plugin when crosscompiling
gRPC doesn't provide the smart tool lookup when crosscompiling.
So gRPC lookup is unable to find the grpc_cpp_plugin plugin when
crosscompiling examples. Use find_program to find the plugin in
host paths.

Pick-to: 6.8 6.9
Fixes: QTBUG-134647
Change-Id: I961b180b348dee4f1b2f2523be225d3003847e4c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2025-03-18 18:08:13 +01:00
Dennis Oberst c0496671be qtgrpc_chat_server: Compile certificates into the application
The previous approach was error-prone, as using TARGET_FILE_DIR
hard-coded the path to the build directory and ignored install locations
entirely.

Fix this by using a more reliable approach: embedding the certificate
strings directly into the application.

Pick-to: 6.9 6.9.0 6.8 6.8.3
Change-Id: Ifb883891fd55bb023e7f9828f9c422ea3e5d1c3e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-03-13 13:11:23 +01:00
Alexey Edelev 413cc7c831 Add vcpkg.json for the QtGRPC chat example
Use the vcpkg manifest to configure and build QtGRPC chat example.
This allows automating the dependency installation using vcpkg.

Pick-to: 6.9
Task-number: QTBUG-132738
Change-Id: Iafcb8e144d51f1af0d775869550f003c997d106a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-03-07 11:10:54 +01:00
Samuli Piippo 54837023ab qtgrpc chat example: don't deploy static lib
Remove deployment of the now static proto lib.

Amends 9437a1f2bd

Pick-to: 6.9
Change-Id: I5bdda6157842c665165ae9b14255778ce2ac0bc9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2025-03-06 10:56:51 +02:00
Dennis Oberst 9437a1f2bd qtgrpc chat example: fix deployment
The deployment was incomplete. Fix it by:
 * Building the dependent qtgrpc_chat_client_proto library as
a static library
 * Add the server directory path for reading credentials universally

Amends: cb35d20adb.

Fixes: QTBUG-134266
Pick-to: 6.9.0 6.9 6.8.3 6.8
Change-Id: I0666c445fbce159436c5b084ffd77d4191e04213
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-03-05 07:58:29 +00:00
Dennis Oberst cb35d20adb Rewrite the qtgrpc chat example
The previous chat example was created many moons ago and much has
happened since then. These are the key improvements for the new qtchat:

- Server uses the Callback API
- Added support for Registering (stored in plain text on server side)
- Use long-lived bidirectional streaming for the ChatRoom method
- Any files can now be shared in any size with all chat users
- Use the Grpc client from a dedicated worker thread to have lag-free
  UIs
- Use the generated protobuf QML-library declaratively in the app
- stylistic improvements
- Use SSL for safe communication
- Automatic reconnections

This is an advanced example showcasing many features of this module.

Pick-to: 6.9 6.8
Fixes: QTBUG-121871
Fixes: QTBUG-122625
Change-Id: I71114375fe91ffb20a235859b6ab51f7b3ab07a3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-02-24 10:41:22 +01:00
Dennis Oberst 6ab4321ccc Docs: create and distribute the \gRPC macro for adding trademarks
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>
2024-12-17 11:08:01 +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
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
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
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
Dennis Oberst 19fca04537 Prefer the usage of SingleShotConnection
Currently we're doing something manually, which, since Qt6 is a
dedicated feature. Use that instead for less error-prone disconnections
for our single-shot signals.

Lets not re-invent the wheel for something that has been (potentially
faster rather then slower) invented for this exact usecase.

We will promote the usage of Qt::SingleShotConnection, so as good
teachers we should be using it as well.

Pick-to: 6.8
Change-Id: I3b2b9f176f06d91b4d0946a38c53a4c2614c8a01
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-09-20 15:48:06 +02:00
Dennis Oberst 2b1c2ec411 chat example: fix sendMessage() new unique_ptr workflow
This was forgotten when we switched to unique_ptr's.

Pick-to: 6.8.0 6.8
Change-Id: I684639bbafc65ea5eea34074a77367b82c9d9054
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-09-12 17:55:37 +02:00
Alexey Edelev 2bb3803df2 Add the missing disconnect to the chat example
We obviously store the lambda and its context forever. Add the explicit
disconnect to cleanup the memory on failure.

Pick-to: 6.8
Change-Id: I1afda515f8c8dc96fec9edb847ee26efd8802c6b
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-08-30 14:28:46 +02:00
Alexey Edelev a1b5a6dd8f Migrate to std::unique_ptr return value for all RPCs
The use of shared pointers has potential risk of storing the
QGrpcOperation children forever and leaking in user code. The problem
is clearly in the lambda connections that we encourage to use in the
docs and examples:

  auto stream = testStream(...);
  QObject::connect(stream.get(), &QGrpcOperation::finished,
                   ctx, [ctx, stream]{...});

The above code will hold the 'stream' forever, unless user will make
the explicit disconnect in the lambda.

By using std::unique_ptr we partially solve this, or at least convince
user to solve this. When user creates lambda he knows the 'stream'
lifetime and most probably should consider that after the move, lambda
is owning the QGrpcOperation, so the need of disconnect is more clear
in this case:

  auto stream = testStream(...);
  auto *streamPtr = stream.get();
  QObject::connect(streamPtr, &QGrpcOperation::finished,
                   ctx, [ctx, stream = std::move(stream)]{...});

The code becomes a bit more complicated, but it points explicitly to
the potential risk. Also it disallows to make this trick to multiple
lambdas at the same time.

Of course using the lambda context to control the QGrpcOperation
lifetime in this case is not necessary. But even if users will decide
to manage the QGrpcOperation lifetime differently, the use of
std::unique_ptr will clearly point to the ownership.

[ChangeLog][Grpc] All generated RPC methods now return std::unique_ptr
instead of std::shared_ptr. This change explicitly defines that caller
takes the ownership of the returned pointers.

Pick-to: 6.8
Change-Id: I271b91454f0c1b12b77127a7e025fa493367e279
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-08-30 12:08:46 +02:00
Alexey Edelev e04f23a76a Generate protobuf enum as enum class
This will unlock the use of enum fields duplicates in the same scope
if the respective feature will be supported by the reference protobuf.

Pick-to: 6.8
Task-number: QTBUG-126992
Change-Id: Ib38e313b62885042e2f75376836d1cb0ad2574db
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-08-28 14:47:48 +02:00
Alexey Edelev a5d79af204 Warn if users attempt building gRPC servers using MinGW
gRPC in examples using the reference grpc++, which depends on abseil.
There is known upstream issue that abseil passes the MSVC only linker
flag that blocks the example compilation with MinGW compiler. The
problem meanwhile is bigger than that, since abseil simply don't have
a proper MinGW support, so we should warn users, that we do not
officially support MinGW in the examples that use the reference gRPC
server implementation.

Pick-to: 6.8 6.7
Fixes: QTBUG-128174
Change-Id: I319c54b5df02dac0be1dee441ec324f54f05ad93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-08-23 12:34:14 +02:00
Alexandru Croitor 9968b84cf7 CMake: Make grpc chat example build as external project with qemu CI
Make sure to look for the ProtobufTools and GrpcTools packages
explicitly, for the grpc 'chat' example, to ensure the public
CMake API is available when the example is built as an external
project.

The Tools packages are not looked up automatically because the target
sysroot is missing protobuf tools dependencies, and thus we never
record a dependency from the target library packages to the tools
packages.

Augments 68b2e1db08
Adapts to 63b9cc81df

Pick-to: 6.8
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-110849
Change-Id: I036a37e0fb9c81de325a33ab6ae7322d14ae0cbc
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-08-19 21:50:15 +02:00
Dennis Oberst 14984ad3a7 QGrpcHttp2Channel: update IWYU and favor fwd declarations
The header includes were not up-to-date.

Task-number: QTBUG-123625
Pick-to: 6.8
Change-Id: Id2a3d21925a0bf2ec6c8dfcb44617db3a8d5059c
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-08-06 09:05:44 +02:00
Dennis Oberst f30945b7f5 QGrpcMetadata: use QHash instead of std::unordered_multimap <QBA, QBA>
There is likely already an instantiation available for it. Prefer the
usage of QHash to stay within the (Qt) lib boundary.

Remove qgrpcdefs.h as it's now obsolete. Update all occurrences of
QGrpcMetadata.

Task-number: QTBUG-123625
Pick-to: 6.8
Change-Id: Ida7bcd851c2d4b247c1b7a8dccddc3d518e0b5ae
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-07-29 09:21:18 +02:00
Dennis Oberst 5479292128 QGrpcStatus: drag 'StatusCode' enum into the qtgrpc namespace
This will make it easier to re-use it. This enum has a high chance of
being reused in the future.

Task-number: QTBUG-123625
Pick-to: 6.8
Change-Id: I587a2ae41e85b03539bc6213f53851ac37a415df
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-07-29 09:20:30 +02:00
Alexey Edelev ec8a3fec71 Remove errorOccurred interface signal from grpc operations
The signal is the redundant attempt to make Qt-style primitives. It
increases the usage complexity without any visible advantages. The
finished signal should instead accept the QGrpcStatus code and allow
users to make the descisions about the success of the operation in a
single call stack.

[ChangeLog][GRPC] The QGrpcOperation::errorOccurred and
QGrpcChannelOperation::errorOccurred signals are removed.

[ChangeLog][GRPC] The QGrpcOperation::finished and
QGrpcChannelOperation::finished signals now have QGrpcStatus argument
that indicates the status received from the server-side for the
operation.

Task-number: QTBUG-123625
Change-Id: I87669e0921c41cef0ff9d408bed1b057ba5198f2
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-30 12:37:19 +02:00
Alexey Edelev 2625537aee Move host URI option to QGrpcHttp2Channel
The host URI is not an optional property of the QGrpcHttp2Channel and
has not relations to QGrpcChannelOptions. We should move it to the
QGrpcHttp2Channel and use it there directly instead of making the
assumption that any channel should be created using the host URI. This
also removes the requirement of having the options as mandatory
argument to construct the gRPC channels.

Task-number: QTBUG-123625
Change-Id: I6cd64bad6c379f8875dcd6794a95bf68b46da605
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-29 16:27:43 +02:00
Dennis Oberst 584a971d35 QGrpc{Channel, Call}Options: prefer 'set~()' over 'with~()'
It was concluded that we will use the 'set~()' syntax in our options but
still return a reference to allow chaining.

Task-number: QTBUG-123625
Change-Id: I00838465b485d096b4b7bd3d691d24385543d662
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-05-28 10:54:19 +02:00
Alexey Edelev d69bc69750 Remove the 'stream' prefix from all streaming methods
There are no particular reasons for these prefixes. Remove them.

[ChangeLog][GRPC] The 'stream' prefix is removed for all generated
streaming methods.

Task-number: QTBUG-123625
Change-Id: Ie1e63a6c559e259956aa3b4b72aa3ef380df4f44
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-15 11:51:01 +02:00
Dennis Oberst 57b875c33b QGrpcOperation: handle failed deserialization directly
Originally motivated by Axivion(SV3), which nagged about the const
errorOccurred signal; this patch removes signal emission for failed
deserialization in the read() functions. Immediately handling this can
lead to better user code as an fallback mechanism can avoid further
execution of unneeded logic.

This patch makes the errorOcurred signal non-const and changes the
signature of the read methods to either return an optional or bool to
signal failure immediately.

Users can then retrieve the error through 'deserializationError()' or
'deserializationErrorString()'. This can be seen in the generated QML
integration code, which uses those to still emit the 'errorOcurred'
signal on deserialization failure.

Change-Id: Ie6761753145536a42d5dd5bf1eac18afa555581a
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-04-18 11:14:09 +02:00
Lucie Gérard 4b21c9ef0d Correct license for example files
According to QUIP-18 [1], all example files should be
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: If6b8c8eb88c8880e6e277f472dfdd5b380a5c83d
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-15 14:28:25 +01:00
Alexey Edelev b9519412ae Move all registration functionality to a separate unit
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>
2024-01-26 20:51:01 +01:00
Tatiana Borisova e17d28e0d0 qRegisterProtobufTypes() should be called for applications implicitly
- Delete manual qRegisterProtobufTypes() call in QML auto-tests
- Add auto-generation line into qtprotobufgen
*_protobuftyperegistrations.cpp file. Now registration is happening via
static variable.

Pick-to: 6.7 6.6
Task-number: QTBUG-117643
Change-Id: Ic9c7e299fd2cd157ff4f2705d34bc4606a83ddbe
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-01-24 11:40:14 +01:00
Alexey Edelev 11bd27f1a6 Adjust the licensing across the repo
Pick-to: 6.7 6.6
Fixes: QTBUG-117783
Change-Id: I85d73a876f911383b31821ba6f7de2a07dcc9f3c
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-01-12 09:54:57 +01:00
Alexey Edelev 5dfa8a431f Add the network error handling to the chat example
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>
2023-11-17 13:44:07 +00:00
Alexey Edelev 1cfd2d8e16 Add upper level project definition for gRPC chat example
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>
2023-11-01 09:59:28 +01:00
Alexey Edelev f3aa84d05b Rename QGrpcStream to QGrpcServerStream
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>
2023-08-28 13:36:38 +02:00
Alexey Edelev 36a64710a9 Format the .proto files according to the clang-format rules
Pick-to: 6.6 6.5
Change-Id: Iedc563ab8689779960dc6a2cc0b5817a874374e0
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-08-23 10:02:50 +02:00
Alexey Edelev b089a773e9 Move enums to the nested namespace out of class
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>
2023-08-18 19:01:25 +02:00
Dennis Oberst 5f75a40f92 chat example: fix unused string usage in server
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>
2023-08-09 15:58:01 +00:00
Alexey Edelev f08446cd8b Migrate to implictily shared lists
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>
2023-06-01 15:51:55 +02:00
Konrad Kujawa d5803c0918 Update QtGRPC chat example to new options and QGrpcMetadata changes
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>
2023-05-23 13:34:34 +02:00
Konrad Kujawa 4235684288 Introduce QGrpcMetadata
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>
2023-05-23 13:34:34 +02:00
Konrad Kujawa 3b8b24c7e5 Introduce QGrpcCallOptions and QGrpcChannelOptions
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>
2023-05-23 13:34:34 +02:00
Alexey Edelev 30104d3c72 Fix warning related to the deprecated AUTORESOURCE_PREFIX argument
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>
2023-05-15 13:01:56 +02: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 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 3b10bf74b2 Add the missing copyright and license headers to the .proto files
Pick-to: 6.5 6.5.0
Change-Id: Id3d75385f251e77aebe0b56a82549e19fd0fbf84
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-03-06 11:20:05 +01:00
Alexey Edelev 4c52dcca60 Fix qml warnings in the chat example
Amends fdd1d0339f

Task-number: QTBUG-109598
Pick-to: 6.5
Change-Id: Ied1bb64f5b70e087c8028a6c88d3bd29fc310aee
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>
2023-03-01 17:29:11 +01:00
Alexey Edelev 272957831e Disable -fPIE for the qtgrpc/qtprotobuf executables
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>
2023-02-24 13:47:33 +01:00
Alexey Edelev fdd1d0339f Backport the simple chat example
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>
2023-02-23 18:29:39 +01:00