Qt Protobuf Well-Known Types C++ Classes

Das Modul Qt Protobuf Well-Known Types bietet Unterstützung für einige der Typen, die im Well-Known Types Paket enthalten sind. Mehr...

Dieses Modul wurde in Qt 6.6 eingeführt.

Klassen

QtProtobuf::Any

Eine Hilfsklasse zur Vereinfachung der Arbeit mit dem Typ protobuf Any

Detaillierte Beschreibung

QtProtobufWellKnownTypes enthält die folgenden Protobuf Well-Known Typen: Unterstützte Typen:

Um bekannte Typen in Ihrem Projekt zu verwenden, können Sie die entsprechende google .proto-Datei in Ihre Schnittstelle einbinden:

syntax = "proto3";
package somepackage;
import "google/protobuf/any.proto";
message Message {
    google.protobuf.Any payload = 1;
}

Um die aufgelisteten Typen zu verwenden, müssen Sie mit der QtProtobuf WellKnownTypes-Bibliothek linken, indem Sie die folgende Zeile in Ihre CMakeLists.txt-Datei einfügen:

target_link_libraries(YourTargetName PRIVATE Qt::ProtobufWellKnownTypes)

© 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.