QtProtobuf Namespace
QtProtobuf 名前空間には、Qt Protobuf をサポートするために必要な型エイリアスやクラスが含まれています。さらに...
ヘッダー | #include <QtProtobuf> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Protobuf) target_link_libraries(mytarget PRIVATE Qt6::Protobuf) |
以来: | Qt 6.5 |
クラス
(since 6.6) class | Any |
型
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 |
関数
void | qRegisterProtobufEnumType() |
void | qRegisterProtobufMapType() |
void | qRegisterProtobufType() |
void | qRegisterProtobufTypes() |
void | registerProtobufQtCoreTypes() |
void | registerProtobufQtGuiTypes() |
型のドキュメント
enum class QtProtobuf::WireTypes
WireTypes列挙は、protobufのデフォルトのワイヤタイプを反映する。
次の表に、列挙の値と対応する型を示します:
定数 | 値 | 説明 |
---|---|---|
QtProtobuf::WireTypes::Unknown | -1 | 無効なワイヤタイプ |
QtProtobuf::WireTypes::Varint | 0 | int32, int64, uint32, uint64, sint32, sint64, bool, enum |
QtProtobuf::WireTypes::Fixed64 | 1 | fixed64、sfixed64、double |
QtProtobuf::WireTypes::LengthDelimited | 2 | 文字列、バイト、埋め込みメッセージ、パックされた繰り返しフィールド |
QtProtobuf::WireTypes::StartGroup | 3 | グループ。proto syntax 3では非推奨。Qt Protobuf ではサポートされていません。 |
QtProtobuf::WireTypes::EndGroup | 4 | グループ。proto 構文 3 では非推奨。Qt Protobuf ではサポートされていません。 |
QtProtobuf::WireTypes::Fixed32 | 5 | fixed32, sfixed32, float。 |
エンコーディングも参照してください 。
[alias]
QtProtobuf::boolList
boolのリストのエイリアス。
[alias]
QtProtobuf::doubleList
ダブルのリストのエイリアス。
[alias]
QtProtobuf::fixed32
fixed32 は符号なし 32 ビット整数で、protobuf では固定サイズの 32 ビットフィールドとして表現される。WireTypes::Fixed32 の別名。
[alias]
QtProtobuf::fixed64
fixed64は符号なし64ビット整数で、protobufでは固定サイズの64ビットフィールドとして表現され、WireTypes::Fixed64 の別名である。
[alias]
QtProtobuf::fixed32List
QtProtobuf::fixed32 のリストのエイリアス。
[alias]
QtProtobuf::fixed64List
QtProtobuf::fixed64 のリストのエイリアス。
[alias]
QtProtobuf::floatList
float のリストのエイリアス。
[alias]
QtProtobuf::int32
int32は通常の符号付き32ビット整数で、protobufでは可変サイズ整数として表現され、WireTypes::Varint の別名である。
[alias]
QtProtobuf::int64
int64は通常の符号付き64ビット整数で、protobufでは可変サイズ整数として表現され、WireTypes::Varint の別名である。
[alias]
QtProtobuf::int32List
QtProtobuf::int32 のリストのエイリアス。
[alias]
QtProtobuf::int64List
QtProtobuf::int64 のリストのエイリアス。
[alias]
QtProtobuf::sfixed32
sfixed32は符号付き32ビット整数で、protobufでは固定サイズの32ビットフィールドとして表現され、WireTypes::Fixed32 の別名である。
[alias]
QtProtobuf::sfixed64
sfixed64 は符号付き64ビット整数で、protobufでは固定サイズの64ビットフィールドとして表現され、WireTypes::Fixed64 の別名である。
[alias]
QtProtobuf::sfixed32List
QtProtobuf::sfixed32 のリストのエイリアス。
[alias]
QtProtobuf::sfixed64List
QtProtobuf::sfixed64 のリストのエイリアス。
[alias]
QtProtobuf::sint32
sint32は強制符号付き32ビット整数で、protobufでは可変サイズ整数として表現され、WireTypes::Varint の別名である。 sint32は負の数のサイズを小さくするためにZigZag変換を使って直列化される。
符号付き整数も参照してください 。
[alias]
QtProtobuf::sint64
sint64は強制符号付き64ビット整数で、protobufでは可変サイズ整数として表現され、WireTypes::Varint の別名である。 sint64は負の数のサイズを小さくするためにZigZag変換を使って直列化される。
符号付き整数も参照してください 。
[alias]
QtProtobuf::sint32List
QtProtobuf::sint32 のリストのエイリアス。
[alias]
QtProtobuf::sint64List
QtProtobuf::sint64 のリストのエイリアス。
[alias]
QtProtobuf::uint32
uint32は符号なし32ビット整数で、protobufでは可変サイズ整数として表現され、WireTypes::Varint の別名である。
[alias]
QtProtobuf::uint64
uint64は符号なし64ビット整数で、protobufでは可変サイズ整数として表現され、WireTypes::Varint の別名である。
[alias]
QtProtobuf::uint32List
QtProtobuf::uint32 のリストのエイリアス。
[alias]
QtProtobuf::uint64List
QtProtobuf::uint64 のリストのエイリアス。
関数ドキュメント
template <typename T, std::enable_if_t<std::is_enum<T>::value, bool> = true> void qRegisterProtobufEnumType()
列挙型T
のシリアライザをQtProtobuf グローバル・シリアライザ・レジストリに登録します。
この関数は通常、生成されたコードによって呼び出されます。
template <typename K, typename V, QtProtobuf::if_protobuf_map<K, V> = true> void qRegisterProtobufMapType()
K
、V
。V
はQProtobufMessage でなければならない。 この関数は通常、生成されたコードから呼び出される。
template <typename T, QtProtobuf::if_protobuf_message<T> = true> void qRegisterProtobufType()
T型のProtobufを登録する。この関数は通常、生成されたコードから呼び出される。
void qRegisterProtobufTypes()
この関数を呼び出すと、現在知られているすべての protobuf 型がシリアライザレジストリに登録されます。
注意: Qt 6.6.3以降では、この関数は自動的に呼び出されるため、手動で呼び出す必要はありません。それ以前のバージョンでは、シリアライズ/デシリアライズの前にこの関数を呼び出す方が良いでしょう。
void QtProtobuf::registerProtobufQtCoreTypes()
Qt::ProtobufQtCoreTypesライブラリのシリアライザを登録します。
void QtProtobuf::registerProtobufQtGuiTypes()
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.