QtProtobuf Namespace
Der QtProtobuf Namespace enthält Typ-Aliase und Klassen, die zur Unterstützung von Qt Protobuf benötigt werden. Mehr...
Kopfzeile: | #include <QtProtobuf> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Protobuf) target_link_libraries(mytarget PRIVATE Qt6::Protobuf) |
Seit: | Qt 6.5 |
Klassen
(since 6.6) class | Any |
Typen
enum class | WireTypes { Unknown, Varint, Fixed64, LengthDelimited, StartGroup, …, Fixed32 } |
boolList | |
doubleList | |
fixed32 | |
fixed64 | |
fixed32List | |
fixed64List | |
floatList | |
int32 | |
int64 | |
int32List | |
int64List | |
sfixed32 | |
sfixed64 | |
sfixed32List | |
sfixed64List | |
sint32 | |
sint64 | |
sint32List | |
sint64List | |
uint32 | |
uint64 | |
uint32List | |
uint64List |
Funktionen
void | qRegisterProtobufEnumType() |
void | qRegisterProtobufMapType() |
void | qRegisterProtobufType() |
void | qRegisterProtobufTypes() |
void | registerProtobufQtCoreTypes() |
void | registerProtobufQtGuiTypes() |
Typ Dokumentation
enum class QtProtobuf::WireTypes
Die Aufzählung WireTypes spiegelt die Standard-Drahttypen von Protobuf wider.
Die folgende Tabelle zeigt die Werte in der Aufzählung und ihre entsprechenden Typen:
Konstante | Wert | Beschreibung |
---|---|---|
QtProtobuf::WireTypes::Unknown | -1 | Ungültiger Drahttyp |
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, eingebettete Nachrichten, gepackte wiederholte Felder |
QtProtobuf::WireTypes::StartGroup | 3 | Gruppen. Veraltet in proto syntax 3. Wird von Qt Protobuf nicht unterstützt. |
QtProtobuf::WireTypes::EndGroup | 4 | Gruppen. Veraltet in der Proto-Syntax 3. Wird von Qt Protobuf nicht unterstützt. |
QtProtobuf::WireTypes::Fixed32 | 5 | fixed32, sfixed32, float |
Siehe auch Kodierung.
[alias]
QtProtobuf::boolList
Alias für eine Liste von bool.
[alias]
QtProtobuf::doubleList
Alias für eine Liste von double.
[alias]
QtProtobuf::fixed32
fixed32 ist eine 32-Bit-Ganzzahl ohne Vorzeichen, die in protobuf als 32-Bit-Feld mit fester Größe dargestellt wird, ein Alias für WireTypes::Fixed32.
[alias]
QtProtobuf::fixed64
fixed64 ist eine vorzeichenlose 64-Bit-Ganzzahl, die in protobuf als 64-Bit-Feld fester Größe dargestellt wird, ein Alias für WireTypes::Fixed64.
[alias]
QtProtobuf::fixed32List
Alias für eine Liste von QtProtobuf::fixed32.
[alias]
QtProtobuf::fixed64List
Alias für eine Liste von QtProtobuf::fixed64.
[alias]
QtProtobuf::floatList
Alias für eine Liste von float.
[alias]
QtProtobuf::int32
int32 ist eine reguläre 32-Bit-Ganzzahl mit Vorzeichen, die in protobuf als Ganzzahl mit variabler Größe dargestellt wird, ein Alias für WireTypes::Varint.
[alias]
QtProtobuf::int64
int64 ist eine reguläre 64-Bit-Ganzzahl mit Vorzeichen, die in protobuf als Ganzzahl variabler Größe dargestellt wird, ein Alias für WireTypes::Varint.
[alias]
QtProtobuf::int32List
Alias für eine Liste von QtProtobuf::int32.
[alias]
QtProtobuf::int64List
Alias für eine Liste von QtProtobuf::int64.
[alias]
QtProtobuf::sfixed32
sfixed32 ist eine vorzeichenbehaftete 32-Bit-Ganzzahl, die in protobuf als 32-Bit-Feld mit fester Größe dargestellt wird, ein Alias für WireTypes::Fixed32.
[alias]
QtProtobuf::sfixed64
sfixed64 ist eine vorzeichenbehaftete 64-Bit-Ganzzahl, die in protobuf als 64-Bit-Feld fester Größe dargestellt wird, ein Alias für WireTypes::Fixed64.
[alias]
QtProtobuf::sfixed32List
Alias für eine Liste von QtProtobuf::sfixed32.
[alias]
QtProtobuf::sfixed64List
Alias für eine Liste von QtProtobuf::sfixed64.
[alias]
QtProtobuf::sint32
sint32 ist eine 32-Bit-Ganzzahl mit erzwungener Vorzeichenmarkierung, die in protobuf als Ganzzahl mit variabler Größe dargestellt wird, ein Alias für WireTypes::Varint. sint32 wird mittels ZigZag-Konvertierung serialisiert, um die Größe negativer Zahlen zu reduzieren.
Siehe auch signed-integers.
[alias]
QtProtobuf::sint64
sint64 ist eine 64-Bit-Ganzzahl mit erzwungener Vorzeichenmarkierung, die in protobuf als Ganzzahl mit variabler Größe dargestellt wird, ein Alias für WireTypes::Varint. sint64 wird mittels ZigZag-Konvertierung serialisiert, um die Größe negativer Zahlen zu reduzieren.
Siehe auch signed-integers.
[alias]
QtProtobuf::sint32List
Alias für eine Liste von QtProtobuf::sint32.
[alias]
QtProtobuf::sint64List
Alias für eine Liste von QtProtobuf::sint64.
[alias]
QtProtobuf::uint32
uint32 ist eine 32-Bit-Ganzzahl ohne Vorzeichen, die in protobuf als Ganzzahl mit variabler Größe dargestellt wird, ein Alias für WireTypes::Varint.
[alias]
QtProtobuf::uint64
uint64 ist eine 64-Bit-Ganzzahl ohne Vorzeichen, die in protobuf als Ganzzahl mit variabler Größe dargestellt wird, ein Alias für WireTypes::Varint.
[alias]
QtProtobuf::uint32List
Alias für eine Liste von QtProtobuf::uint32.
[alias]
QtProtobuf::uint64List
Alias für eine Liste von QtProtobuf::uint64.
Funktion Dokumentation
template <typename T, std::enable_if_t<std::is_enum<T>::value, bool> = true> void qRegisterProtobufEnumType()
Registriert Serialisierer für den Aufzählungstyp T
in QtProtobuf global serializers registry.
Diese Funktion wird normalerweise von generiertem Code aufgerufen.
template <typename K, typename V, QtProtobuf::if_protobuf_map<K, V> = true> void qRegisterProtobufMapType()
Registriert eine Protobuf-Map vom Typ K
und V
. V
muss ein QProtobufMessage sein. Diese Funktion wird normalerweise von generiertem Code aufgerufen.
template <typename T, QtProtobuf::if_protobuf_message<T> = true> void qRegisterProtobufType()
Registriert einen Protobuf Typ T. Diese Funktion wird normalerweise von generiertem Code aufgerufen.
void qRegisterProtobufTypes()
Der Aufruf dieser Funktion registriert alle derzeit bekannten Protobuf-Typen in der Serializer-Registry.
Hinweis: Erst seit Qt 6.6.3 müssen Sie diese Funktion nicht mehr manuell aufrufen, da sie automatisch aufgerufen wird. Für frühere Versionen ist es besser, sie vor dem Versuch der Serialisierung/Deserialisierung aufzurufen.
void QtProtobuf::registerProtobufQtCoreTypes()
Registriert Serialisierer für die Qt::ProtobufQtCoreTypes Bibliothek.
void QtProtobuf::registerProtobufQtGuiTypes()
Registriert Serialisierer für die Bibliothek Qt::ProtobufQtGuiTypes.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.