This lib should help with usage of generated sources from Google Protobuf files with Qt and QML.
Just write plugin for current C++ generator:
- Add getter/setter for std::string as QString
- Mark all messages classes as QObject
- Add Q_PROPERTY for all messages fields
- Wrap repeated fields by QQmlListProperty
- Add signals for fields changes
- Build compiler
- Generate sources; example command:
protoc --plugin=protoc-gen-qt=protoc-gen-qt --cpp_out=. --qt_out=. Test.proto
- Profit
$full_name$
mean:
package.ClassName
for message typepackage.ClassName.field_name
for field
- includes
- namespace_scope
- global_scope
- class_definition:$full_name$
- dep_base_class_definition:$full_name$
- class_scope:$full_name$
- constructor:$full_name$
- arena_constructor:$full_name$
- copy_constructor:$full_name$
- destructor:$full_name$
- message_clear_start:$full_name$
- one_of_clear_start:$full_name$
- generalized_merge_from_start:$full_name$
- generalized_merge_from_cast_fail:$full_name$
- generalized_merge_from_cast_success:$full_name$
- class_specific_merge_from_start:$full_name$
- generalized_copy_from_start:$full_name$
- class_specific_copy_from_start:$full_name$
- parse_start:$full_name$
- parse_success:$full_name$
- parse_failure:$full_name$
- serialize_start:$full_name$
- serialize_end:$full_name$
- serialize_to_array_start:$full_name$
- serialize_to_array_end:$full_name$
- message_set_byte_size_start:$full_name$
- required_fields_byte_size_fallback_start:$full_name$
- message_byte_size_start:$full_name$
- field_get:$full_name$
- field_set:$full_name$
- field_get:$full_name$
- field_set:$full_name$
- field_add:$full_name$
- field_list:$full_name$
- field_mutable_list:$full_name$
- field_get:$full_name$
- field_set:$full_name$
- field_set_rvalue:$full_name$
- field_set_char:$full_name$
- field_set_pointer:$full_name$
- field_mutable:$full_name$
- field_release:$full_name$
- field_set_allocated:$full_name$
- field_unsafe_arena_release:$full_name$
- field_unsafe_arena_set_allocated:$full_name$
- field_get:$full_name$
- field_set:$full_name$
- field_set_rvalue:$full_name$
- field_set_char:$full_name$
- field_set_pointer:$full_name$
- field_mutable:$full_name$
- field_add_mutable:$full_name$
- field_add:$full_name$
- field_add_char:$full_name$
- field_add_pointer:$full_name$
- field_list:$full_name$
- field_mutable_list:$full_name$
- field_get:$full_name$
- field_set:$full_name$
- field_get:$full_name$
- field_set:$full_name$
- field_add:$full_name$
- field_list:$full_name$
- field_mutable_list:$full_name$
- field_map:$full_name$
- field_mutable_map:$full_name$
- field_unsafe_arena_set_allocated:$full_name$
- field_get:$full_name$
- field_release:$full_name$
- field_unsafe_arena_release:$full_name$
- field_mutable:$full_name$
- field_set_allocated:$full_name$
- field_add:$full_name$
- field_mutable:$full_name$
- field_get:$full_name$
- field_list:$full_name$