mirror of https://github.com/qt/qtgrpc.git
Merge tag 'v6.5.6-lts' into tqtc/lts-6.5-opensource
Qt 6.5.6-lts release Conflicts solved: dependencies.yaml Change-Id: If477a2fba4088c821dcf356d117e5ff02da02206
This commit is contained in:
commit
ddb7e27de6
|
|
@ -1,4 +1,4 @@
|
|||
set(QT_REPO_MODULE_VERSION "6.5.5")
|
||||
set(QT_REPO_MODULE_VERSION "6.5.6")
|
||||
set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
|
||||
|
||||
set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_LEAN_HEADERS=1")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
version: 2
|
||||
alias: qtgrpc
|
||||
accept_configuration:
|
||||
condition: property
|
||||
property: features
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
dependencies:
|
||||
../tqtc-qtbase:
|
||||
ref: fdf57f5df57e7d12cf871699d857a71acf272e0c
|
||||
ref: c8b4df9358c8496238f0f58869094cae4dda3e89
|
||||
required: true
|
||||
../tqtc-qtdeclarative:
|
||||
ref: 7ac842cba18be081ac835bf40ac475ec4c47d30b
|
||||
ref: 7170e18bbb886858716854bc4dbee7d5d88810bc
|
||||
required: false
|
||||
|
|
|
|||
|
|
@ -17,13 +17,16 @@ qhp.QtGrpc.indexTitle = Qt GRPC
|
|||
qhp.QtGrpc.indexRoot =
|
||||
|
||||
qhp.QtGrpc.subprojects = qmltypes examples classes
|
||||
|
||||
qhp.QtGrpc.subprojects.qmltypes.title = QML Types
|
||||
qhp.QtGrpc.subprojects.qmltypes.indexTitle = Qt GRPC QML Types
|
||||
qhp.QtGrpc.subprojects.qmltypes.selectors = qmlclass
|
||||
qhp.QtGrpc.subprojects.qmltypes.sortPages = true
|
||||
|
||||
qhp.QtGrpc.subprojects.examples.title = Examples
|
||||
qhp.QtGrpc.subprojects.examples.indexTitle = Qt GRPC Examples
|
||||
qhp.QtGrpc.subprojects.examples.selectors = doc:example
|
||||
|
||||
qhp.QtGrpc.subprojects.classes.title = C++ Classes
|
||||
qhp.QtGrpc.subprojects.classes.indexTitle = Qt GRPC C++ Classes
|
||||
qhp.QtGrpc.subprojects.classes.selectors = class doc:headerfile
|
||||
|
|
@ -32,9 +35,11 @@ qhp.QtGrpc.subprojects.classes.sortPages = true
|
|||
depends += qtdoc qtcore qtnetwork qtwidgets qtprotobuf qtcmake
|
||||
|
||||
{headerdirs,sourcedirs} += .. \
|
||||
../../tools/doc/src
|
||||
../../tools/doc/src \
|
||||
../../tools/qtgrpcgen/doc/src
|
||||
|
||||
exampledirs += ../../tools/doc/src/snippets \
|
||||
|
||||
exampledirs += ../../tools/qtgrpcgen/doc/src/snippets \
|
||||
../../../examples/grpc
|
||||
|
||||
imagedirs += images \
|
||||
|
|
@ -48,6 +53,5 @@ manifestmeta.highlighted.names = "QtGrpc/Magic 8 Ball"
|
|||
|
||||
tagfile = qtgrpc.tags
|
||||
|
||||
# Fail the documentation build if there are more warnings than the limit
|
||||
# Enforce zero documentation warnings
|
||||
warninglimit = 0
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ target_link_libraries(mytarget PRIVATE Qt6::Grpc)
|
|||
|
||||
To generate gRPC services using Qt GRPC and link them with your program
|
||||
consider the following example:
|
||||
\include qt-add-grpc-example.qdocinc
|
||||
\include qt-add-grpc-example.qdocinc 0
|
||||
|
||||
\sa{CMake Command Reference}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ target to the protobuf one:
|
|||
Since gRPC supports a client-server architecture, \c CLIENT or
|
||||
\c SERVER source code may be generated.
|
||||
\note for Qt 6.5 only \c CLIENT source code generation is supported.
|
||||
\include qtprotogen-options.qdocinc
|
||||
\include qtprotogen-cmake-options.qdocinc
|
||||
\include qtprotogen-options.qdocinc 0
|
||||
\include qtprotogen-cmake-options.qdocinc 0
|
||||
\endlist
|
||||
|
||||
\sa{The qtgrpcgen Tool}
|
||||
|
|
|
|||
|
|
@ -9,16 +9,17 @@
|
|||
|
||||
The Qt GRPC and \l {Qt Protobuf} modules together allow you to define data
|
||||
and messages in \c proto files, and then use the code generators,
|
||||
which generate code allowing accessors for fields and gRPC services
|
||||
in the Qt framework. Such code allows users to communicate with the server
|
||||
by sending calls or stream messages.
|
||||
which generate client code allowing accessors for fields and gRPC services
|
||||
in the Qt framework. The code generated by Qt GRPC enables client code to
|
||||
communicate with a gRPC server (regardless of whether the server uses Qt)
|
||||
by sending calls or streaming messages.
|
||||
|
||||
\section1 Overview
|
||||
|
||||
gRPC is a cross-platform high performance Remote
|
||||
Procedure Call (RPC) framework, that generates client/server
|
||||
bindings for a lot of languages. Usually, you use it to connect
|
||||
services in a microservices-style architecture or connecting
|
||||
services in a microservices-style architecture or to connect
|
||||
mobile applications and browsers to backend services.
|
||||
The gRPC clients and servers can run and talk to each other in
|
||||
various environments, and you can write in any of gRPC’s
|
||||
|
|
@ -38,7 +39,10 @@
|
|||
native gRPC channels.
|
||||
See \l {https://grpc.io/docs/languages/cpp/quickstart/}
|
||||
{gRPC for C++} for details.
|
||||
\li \l {OpenSSL Toolkit} may be needed.
|
||||
\endlist
|
||||
\note Check the \l {Example of installation for Windows using vcpkg}
|
||||
to see how to install \c gRPC and \c Protobuf and to run Qt GRPC examples.
|
||||
|
||||
To start working with the Qt GRPC functionality you should define
|
||||
required services and messages in a \c .proto file.
|
||||
|
|
@ -82,7 +86,7 @@
|
|||
As a result, the full example of a CMake project file,
|
||||
that uses Qt GRPC functionality shall be:
|
||||
|
||||
\include qt-add-grpc-example.qdocinc
|
||||
\include qt-add-grpc-example.qdocinc 0
|
||||
|
||||
\section1 Class Documentation
|
||||
\list
|
||||
|
|
@ -108,4 +112,16 @@
|
|||
\list
|
||||
\li \l {Qt GRPC Examples}
|
||||
\endlist
|
||||
|
||||
\section1 Licenses and Attributions
|
||||
|
||||
The Qt GRPC module is available under commercial licenses from \l{The Qt Company}.
|
||||
In addition, it is available under free software licenses:
|
||||
The \l{GNU General Public License, version 3}.
|
||||
See \l{Qt Licensing} for further details.
|
||||
|
||||
Furthermore, Qt GRPC in Qt \QtVersion may contain third party
|
||||
modules under the following permissive licenses:
|
||||
|
||||
\generatelist{groupsbymodule attributions-qtgrpc-tools}
|
||||
*/
|
||||
|
|
@ -17,13 +17,16 @@ qhp.QtProtobuf.indexTitle = Qt Protobuf
|
|||
qhp.QtProtobuf.indexRoot =
|
||||
|
||||
qhp.QtProtobuf.subprojects = qmltypes examples classes
|
||||
|
||||
qhp.QtProtobuf.subprojects.qmltypes.title = QML Types
|
||||
qhp.QtProtobuf.subprojects.qmltypes.indexTitle = Qt Protobuf QML Types
|
||||
qhp.QtProtobuf.subprojects.qmltypes.selectors = qmlclass
|
||||
qhp.QtProtobuf.subprojects.qmltypes.sortPages = true
|
||||
|
||||
qhp.QtProtobuf.subprojects.examples.title = Examples
|
||||
qhp.QtProtobuf.subprojects.examples.indexTitle = Qt Protobuf Examples and Tutorials
|
||||
qhp.QtProtobuf.subprojects.examples.selectors = doc:example
|
||||
|
||||
qhp.QtProtobuf.subprojects.classes.title = C++ Classes
|
||||
qhp.QtProtobuf.subprojects.classes.indexTitle = Qt Protobuf C++ Classes
|
||||
qhp.QtProtobuf.subprojects.classes.selectors = class doc:headerfile
|
||||
|
|
@ -32,10 +35,11 @@ qhp.QtProtobuf.subprojects.classes.sortPages = true
|
|||
depends += qtdoc qtcore qtcmake qtgrpc qtwidgets
|
||||
|
||||
{headerdirs,sourcedirs} += ..
|
||||
sourcedirs += ../../tools/doc/src
|
||||
sourcedirs += ../../tools/doc/src \
|
||||
../../tools/qtprotobufgen/doc/src
|
||||
|
||||
exampledirs += ../../../examples/protobuf \
|
||||
../../tools/doc/src/snippets
|
||||
../../tools/qtprotobufgen/doc/src/snippets
|
||||
|
||||
imagedirs += images \
|
||||
../../../examples/protobuf/sensors/doc/images
|
||||
|
|
@ -48,6 +52,5 @@ manifestmeta.highlighted.names = "QtProtobuf/Sensors"
|
|||
|
||||
tagfile = qtprotobuf.tags
|
||||
|
||||
# Fail the documentation build if there are more warnings than the limit
|
||||
# Enforce zero documentation warnings
|
||||
warninglimit = 0
|
||||
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ target_link_libraries(mytarget PRIVATE Qt6::Protobuf)
|
|||
\endcode
|
||||
|
||||
You can use \e {qt-add-protobuf} CMake macros.
|
||||
The macros implicitly calls Protobuf code generation for qt-project.
|
||||
The macros implicitly call Protobuf code generation for qt-project.
|
||||
|
||||
The macros usage example:
|
||||
\include qt-add-protobuf-example.qdocinc
|
||||
The macros usage examples:
|
||||
\include qt-add-protobuf-example.qdocinc 0
|
||||
|
||||
\sa{CMake Command Reference}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ link to.
|
|||
|
||||
\section1 Arguments
|
||||
\list
|
||||
\include qtprotogen-options.qdocinc
|
||||
\include qtprotogen-cmake-options.qdocinc
|
||||
\include qtprotogen-options.qdocinc 0
|
||||
\include qtprotogen-cmake-options.qdocinc 0
|
||||
\endlist
|
||||
|
||||
\sa{The qtprotobufgen Tool}
|
||||
|
|
@ -99,5 +99,5 @@ have the \c test_messages target as a transitive dependency.
|
|||
|
||||
\section1 Example
|
||||
|
||||
\include qt-add-protobuf-example.qdocinc
|
||||
\include qt-add-protobuf-example.qdocinc 0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,9 +17,10 @@ QT_BEGIN_NAMESPACE
|
|||
\reentrant
|
||||
|
||||
The QProtobufSerializer class registers serializers/deserializers for
|
||||
classes implementing a protobuf message, inheriting QProtobufMessage. These
|
||||
classes are generated automatically, based on a .proto file, using the cmake
|
||||
build macro qt6_add_protobuf or by running qtprotobufgen directly.
|
||||
classes implementing a protobuf message, inheriting \l QProtobufMessage. These
|
||||
classes are generated automatically, based on a \c{.proto} file, using the CMake
|
||||
function \l qt_add_protobuf or by running
|
||||
\l {The qtprotobufgen Tool} {qtprotobufgen} directly.
|
||||
|
||||
This class should be used as a base for specific serializers. The handlers
|
||||
property contains all message-specific serializers and should be used while
|
||||
|
|
|
|||
|
|
@ -72,9 +72,10 @@ QtProtobufPrivate::SerializationHandler QtProtobufPrivate::findHandler(QMetaType
|
|||
basic functions for serialization/deserialization.
|
||||
|
||||
The QProtobufSerializer class registers serializers/deserializers for
|
||||
classes implementing a protobuf message, inheriting QProtobufMessage. These
|
||||
classes are generated automatically, based on a .proto file, using the cmake
|
||||
build macro qt6_add_protobuf or by running qtprotobufgen directly.
|
||||
classes implementing a protobuf message, inheriting \l QProtobufMessage. These
|
||||
classes are generated automatically, based on a \c{.proto} file, using the CMake
|
||||
function \l qt_add_protobuf or by running
|
||||
\l {The qtprotobufgen Tool} {qtprotobufgen} directly.
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -528,14 +528,20 @@ QT_IMPL_METATYPE_EXTERN_TAGGED(QtProtobuf::sfixed64, QtProtobuf_sfixed64)
|
|||
|
||||
/*!
|
||||
\fn template<typename T> bool QtProtobuf::repeatedValueCompare(const QList<std::shared_ptr<T>> &a, const QList<std::shared_ptr<T>> &b)
|
||||
\fn template<typename K, typename V> bool QtProtobuf::repeatedValueCompare(const QHash<K, V> &a, const QHash<K, V> &b)
|
||||
\fn template<typename K, typename V> bool repeatedValueCompare(const QHash<K, std::shared_ptr<V>> &a, const QHash<K, std::shared_ptr<V>> &b)
|
||||
|
||||
Compares two \c{repeated} fields (essentially a list) to each other.
|
||||
Returns \c true if the two fields are equal, \c false otherwise.
|
||||
Returns \c true if \a a is equal to \a b, \c false otherwise.
|
||||
|
||||
These functions are used in the generated code to implement operator==.
|
||||
These functions are used in the generated code to implement \c {operator==}.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename K, typename V> bool repeatedValueCompare(const QHash<K, std::shared_ptr<V>> &a, const QHash<K, std::shared_ptr<V>> &b)
|
||||
|
||||
Compares two \c{map} fields to each other.
|
||||
Returns \c true if \a a is equal to \a b, \c false otherwise.
|
||||
|
||||
These functions are used in the generated code to implement \c {operator==}.
|
||||
*/
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
//! [0]
|
||||
\li \c PROTO_FILES is the list of \c .proto files that will be used in the
|
||||
generation procedure.
|
||||
\li \c PROTO_INCLUDES is the list of directories that will be searched for
|
||||
|
|
@ -11,3 +15,4 @@ custom project install rules.
|
|||
\li \c OUTPUT_TARGETS can be used to specify a variable that will
|
||||
hold the list of targets created by the function. This list can be useful for
|
||||
custom project install rules.
|
||||
//! [0]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
//! [0]
|
||||
\li \c COPY_COMMENTS Copies comments from \c .proto files. If provided in
|
||||
the parameter list, comments related to messages and fields are copied to
|
||||
generated header files.
|
||||
|
|
@ -13,3 +17,4 @@ namespace.
|
|||
the generated code. The generated macro name is constructed as
|
||||
\c QPB_<EXPORT_MACRO>_EXPORT. If the option is not set, the macro is not
|
||||
generated.
|
||||
//! [0]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
//! [0]
|
||||
\snippet qt-add-grpc-example.cmake 0
|
||||
|
||||
The example above calls the \c{qt_add_grpc()}
|
||||
|
|
@ -10,3 +14,4 @@ to generate protobuf message classes for the project.
|
|||
Finally, the example creates a target for an executable called
|
||||
\e{MyApp} which links to the \e{MyGrpcClient} and
|
||||
\e{MyProtoMessageLib} libraries.
|
||||
//! [0]
|
||||
|
|
@ -61,6 +61,6 @@ Options have direct aliases in the \l{qt_add_grpc} function. The following
|
|||
options are supported:
|
||||
|
||||
\list
|
||||
\include qtprotogen-options.qdocinc
|
||||
\include qtprotogen-options.qdocinc 0
|
||||
\endlist
|
||||
*/
|
||||
|
|
@ -417,7 +417,15 @@ endfunction()
|
|||
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
|
||||
function(qt_add_protobuf)
|
||||
if(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
|
||||
set(single_out_args OUTPUT_HEADERS OUTPUT_TARGETS)
|
||||
|
||||
cmake_parse_arguments(PARSE_ARGV 1 arg "" "${single_out_args}" "")
|
||||
qt6_add_protobuf(${ARGN})
|
||||
foreach(out_arg IN LISTS single_out_args)
|
||||
if(arg_${out_arg})
|
||||
set(${arg_${out_arg}} "${${arg_${out_arg}}}" PARENT_SCOPE)
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
message(FATAL_ERROR "qt6_add_protobuf() is only available in Qt 6. "
|
||||
"Please check the protobuf documentation for alternatives.")
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
//! [0]
|
||||
\badcode
|
||||
cmake_minimum_required(VERSION 3.16...3.22)
|
||||
project(MyThings)
|
||||
|
|
@ -28,3 +32,4 @@ in the specified directories.
|
|||
|
||||
We then create a target for an executable called \c{MyApp} which we link
|
||||
to the \c{MyMessages} library.
|
||||
//! [0]
|
||||
|
|
@ -35,7 +35,7 @@ The following CMake commands integrate a protobuf schema into a Qt project.
|
|||
Usually \c qtprotobufgen would be invoked through CMake using the
|
||||
\c{qt_add_protobuf} macro, as shown in the following example:
|
||||
|
||||
\include qt-add-protobuf-example.qdocinc
|
||||
\include qt-add-protobuf-example.qdocinc 0
|
||||
|
||||
\section2 Running manually
|
||||
|
||||
|
|
@ -63,6 +63,6 @@ Options have direct aliases in the \l{qt_add_protobuf} function. The following
|
|||
options are supported:
|
||||
|
||||
\list
|
||||
\include qtprotogen-options.qdocinc
|
||||
\include qtprotogen-options.qdocinc 0
|
||||
\endlist
|
||||
*/
|
||||
Loading…
Reference in New Issue