Any Class | Qt Protobuf 6.8.0
Description: A helper class to simplify working with the protobuf Any type.

- Qt 6.8
- Qt Protobuf
- C++ Classes
- QtProtobufWellKnownTypes (Technical Preview)
- Any
- Qt 6.8.0 Reference Documentation

# Any Class

class QtProtobuf::Any

A helper class to simplify working with the protobuf Any type. More...

Header: | `#include <Any>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS ProtobufWellKnownTypes)` `target_link_libraries(mytarget PRIVATE Qt6::ProtobufWellKnownTypes)`
qmake: | `QT += protobufwellknowntypes`
Since: | Qt 6.6
Inherits: | QProtobufMessage
Status: | Technical Preview

- List of all members, including inherited members

This class is equality-comparable.

## Public Functions

| ~Any()
int | setTypeUrl(const class QString &typeUrl)
int | setValue(const class QByteArray &value)

## Detailed Description

The Any class enables easy casting to and from other types using as() and fromMessage().

It is the type used in code generated by qtprotobufgen when a message contains a field of the `google.protobuf.Any` type.

## Member Function Documentation

### `[noexcept]` Any::~Any()

Destroys this instance of Any

### int Any::setTypeUrl(const class QString &typeUrl)

Sets the type URL for the data contained to typeUrl.

Note: No verification is performed on the input to test if it's correct or in a valid format.

Note: Setter function for property typeUrl.

See also typeUrl() and fromMessage().

### int Any::setValue(const class QByteArray &value)

Sets the raw bytes of the value stored to value.

value must be the output of serializing a message.

Note: Setter function for property value.

See also value() and fromMessage().