diff options
author | Ivan Komissarov <ABBAPOH@gmail.com> | 2019-05-03 09:15:34 +0200 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2019-05-06 08:51:42 +0000 |
commit | c7b10ae7ed9c04628505ed7d7ca3b07f66a0eeb1 (patch) | |
tree | 4774cd5f0121eacc794097edcca196f0cc64ea66 /doc | |
parent | fccfa6859bc019fae40fdcbcc6113c9c3b35e4b7 (diff) |
doc: Add protobuf.cpp example
Change-Id: I6b3460c2e1b007716611bf850c29a20b59234236
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/reference/modules/protobufcpp-module.qdoc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/reference/modules/protobufcpp-module.qdoc b/doc/reference/modules/protobufcpp-module.qdoc index 688f1d9e2..63c56c6ca 100644 --- a/doc/reference/modules/protobufcpp-module.qdoc +++ b/doc/reference/modules/protobufcpp-module.qdoc @@ -36,6 +36,25 @@ The \c protobuf.cpp module provides support for generating C++ headers and sources from proto definition files using the \l protoc tool. + A simple qbs file that uses protobuf can be written as follows: + \code + CppApplication { + Depends { name: "protobuf.cpp" } + files: ["foo.proto", "main.cpp"] + } + \endcode + A generated header now can be included in the C++ sources: + \code + #include <foo.pb.h> + + int main(int argc, char* argv[]) { + Foo bar; + bar.set_answer(42); + google::protobuf::ShutdownProtobufLibrary(); + return 0; + } + \endcode + \section2 Relevant File Tags \table |