QProtobufMessage Class
Base class for all protobuf messages. More...
Header: | #include <QProtobufMessage> |
Public Functions
QVariant | property(QAnyStringView propertyName) const |
bool | setProperty(QAnyStringView propertyName, const QVariant &value) |
bool | setProperty(QAnyStringView propertyName, QVariant &&value) |
Static Public Members
int | constructByName(const QString &messageType) |
Protected Functions
QProtobufMessage(const QMetaObject *metaObject) | |
QProtobufMessage(const QProtobufMessage &other) | |
~QProtobufMessage() | |
QProtobufMessage & | operator=(const QProtobufMessage &other) |
Static Protected Members
bool | isEqual(const QProtobufMessage &lhs, const QProtobufMessage &rhs) |
Detailed Description
\inmodule
QtProtobuf
Provides access to the properties of a message, using setProperty() and property(), without depending on what the message is.
Member Function Documentation
[explicit protected]
QProtobufMessage::QProtobufMessage(const QMetaObject *metaObject)
\internal
Used from generated classes to construct the QProtobufMessage base class. Internally the metaObject is used to query QMetaProperty
[protected]
QProtobufMessage::QProtobufMessage(const QProtobufMessage &other)
\internal
[noexcept protected]
QProtobufMessage::~QProtobufMessage()
\internal
[static]
int QProtobufMessage::constructByName(const QString &messageType)
Constructs QProtobufMessage using messageType. Returns a pointer to the constructed QProtobufMessage.
This function attempts to create a message whose type matches messageType. If messageType is unknown, the function returns nullptr
. If the message is not found in the registry, the function returns nullptr
. Ownership of the constructed message is given to the function caller.
[static noexcept protected]
bool QProtobufMessage::isEqual(const QProtobufMessage &lhs, const QProtobufMessage &rhs)
\internal
QVariant QProtobufMessage::property(QAnyStringView propertyName) const
Get the value of the property propertyName.
If the propertyName isn't known then the returned QVariant is invalid.
See also setProperty().
bool QProtobufMessage::setProperty(QAnyStringView propertyName, const QVariant &value)
Set the property propertyName to the value stored in value.
If the propertyName isn't a part of the known fields then the value will not be written and the function returns false
.
Returns false
if it failed to store the value on the property. Otherwise true
.
See also property().
bool QProtobufMessage::setProperty(QAnyStringView propertyName, QVariant &&value)
This is an overloaded function.
\since
6.6
[protected]
QProtobufMessage &QProtobufMessage::operator=(const QProtobufMessage &other)
\internal