From c7b10ae7ed9c04628505ed7d7ca3b07f66a0eeb1 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Fri, 3 May 2019 09:15:34 +0200 Subject: doc: Add protobuf.cpp example Change-Id: I6b3460c2e1b007716611bf850c29a20b59234236 Reviewed-by: Christian Kandeler --- doc/reference/modules/protobufcpp-module.qdoc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc') 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 + + int main(int argc, char* argv[]) { + Foo bar; + bar.set_answer(42); + google::protobuf::ShutdownProtobufLibrary(); + return 0; + } + \endcode + \section2 Relevant File Tags \table -- cgit v1.2.3