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 | string、bytes、埋め込みメッセージ、パケット化された繰り返しフィールド |
QtProtobuf::WireTypes::StartGroup | 3 | グループ。proto構文3では非推奨。Qt Protobuf ではサポートされていません。 |
QtProtobuf::WireTypes::EndGroup | 4 | グループ。Proto 構文 3 では非推奨。Qt Protobuf ではサポートされていません。 |
QtProtobuf::WireTypes::Fixed32 | 5 | fixed32、sfixed32、float |
「encoding」も参照してください 。
[alias] QtProtobuf::boolList
bool型のリストの別名。
[alias] QtProtobuf::doubleList
double型のリストの別名。
[alias] QtProtobuf::fixed32
fixed32 は、protobuf では固定サイズの 32 ビットフィールドとして表現される符号なし 32 ビット整数であり、WireTypes::Fixed32 の別名です。
[alias] QtProtobuf::fixed64
fixed64 は、protobuf では固定サイズの 64 ビットフィールドとして表現される符号なし 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 変換を使用してシリアライズされます。
signed-integersも参照してください 。
[alias] QtProtobuf::sint64
sint64 は、強制符号マーカー付きの 64 ビット整数であり、Protobuf では可変長整数として表現されます。これは `WireTypes::Varint` の別名です。sint64 は、負の数のサイズを削減するために ZigZag 変換を使用してシリアライズされます。
signed-integersも参照してください 。
[alias] QtProtobuf::sint32List
QtProtobuf::sint32 の一覧に対するエイリアス。
[alias] QtProtobuf::sint64List
QtProtobuf::sint64 の一覧に対するエイリアス。
[alias] QtProtobuf::uint32
uint32 は、プロトブフでは可変長整数として表現される符号なし 32 ビット整数であり、WireTypes::Varint の別名です。
[alias] QtProtobuf::uint64
uint64 は、プロトブフでは可変長整数として表現される符号なし 64 ビット整数であり、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> requires QtProtobuf::if_protobuf_map<K, V> void qRegisterProtobufMapType()
Protobufのマップ型K およびV を登録します。V はQProtobufMessage でなければなりません。この関数は通常、生成されたコードによって呼び出されます。
template <typename T> requires QtProtobuf::if_protobuf_message<T> void qRegisterProtobufType()
Protobuf 型T を登録します。この関数は通常、生成されたコードによって呼び出されます。
void qRegisterProtobufTypes()
この関数を呼び出すと、現在知られているすべてのProtobuf型がシリアライザレジストリに登録されます。
注: Qt 6.6.3以降では、 この関数は自動的に呼び出されるため、手動で呼び出す必要はありません。それ以前のバージョンでは、シリアライズやデシリアライズを行う前に、この関数を呼び出すことをお勧めします。
void QtProtobuf::registerProtobufQtCoreTypes()
Qt::ProtobufQtCoreTypes ライブラリ用のシリアライザを登録します。
void QtProtobuf::registerProtobufQtGuiTypes()
Qt::ProtobufQtGuiTypes ライブラリ用のシリアライザを登録します。
© 2026 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.