QtProtobuf Namespace
The QtProtobuf namespace contains type aliases and classes needed to support QtProtobuf. More...
Header: | #include <QtProtobuf> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Protobuf) target_link_libraries(mytarget PRIVATE Qt6::Protobuf) |
Since: | Qt 6.5 |
Types
enum class | WireTypes { Unknown, Varint, Fixed64, LengthDelimited, StartGroup, …, Fixed32 } |
boolList | |
doubleList | |
floatList |
Functions
void | qRegisterProtobufTypes() |
bool | repeatedValueCompare(const int) |
bool | repeatedValueCompare(const QHash<K, V> &a, const QHash<K, V> &b) |
Detailed Description
Type Documentation
enum class QtProtobuf::WireTypes
The WireTypes enumeration reflects protobuf default wiretypes.
The following table shows the values in the enumeration and their corresponding types:
Constant | Value | Description |
---|---|---|
QtProtobuf::WireTypes::Unknown | -1 | Invalid wire type |
QtProtobuf::WireTypes::Varint | 0 | int32, int64, uint32, uint64, sint32, sint64, bool, enum |
QtProtobuf::WireTypes::Fixed64 | 1 | fixed64, sfixed64, double |
QtProtobuf::WireTypes::LengthDelimited | 2 | string, bytes, embedded messages, packed repeated fields |
QtProtobuf::WireTypes::StartGroup | 3 | groups. Deprecated in proto syntax 3. Not supported by QtProtobuf. |
QtProtobuf::WireTypes::EndGroup | 4 | groups. Deprecated in proto syntax 3. Not supported by QtProtobuf. |
QtProtobuf::WireTypes::Fixed32 | 5 | fixed32, sfixed32, float |
See also encoding.
[alias]
QtProtobuf::boolList
Alias for a list of bool.
[alias]
QtProtobuf::doubleList
Alias for a list of double.
[alias]
QtProtobuf::floatList
Alias for a list of float.
Function Documentation
template <typename K, typename V> bool QtProtobuf::repeatedValueCompare(const QHash<K, V> &a, const QHash<K, V> &b)
template <typename T> bool QtProtobuf::repeatedValueCompare(const int)
Compares two repeated
fields (essentially a list) to each other. Returns true
if the two fields are equal, false
otherwise.
These functions are used in the generated code to implement operator==.
void qRegisterProtobufTypes()
Calling this function registers all, currently known, protobuf types with the serializer registry.
Note: You should not have to call this function manually, as it is called automatically upon attempting serialization or deserialization of a protobuf message.