Field Class
class QXmppDataForm::FieldPublic Functions
(since QXmpp 1.3) | Field(QXmppDataForm::Field::Type type = TextSingleField, const QString &key = {}, const QVariant &value = {}, bool isRequired = false, const QString &label = {}, const QString &description = {}, const QList<QPair<QString, QString>> &options = {}) |
| Field(const QXmppDataForm::Field &other) | |
| Field(QXmppDataForm::Field &&) | |
| ~Field() | |
| QString | description() const |
| bool | isRequired() const |
| QString | key() const |
| QString | label() const |
(since QXmpp 1.1) QSize | mediaSize() const |
(since QXmpp 1.1) QVector<QXmppDataForm::MediaSource> | mediaSources() const |
| QList<QPair<QString, QString>> | options() const |
| void | setDescription(const QString &description) |
| void | setKey(const QString &key) |
| void | setLabel(const QString &label) |
(since QXmpp 1.1) void | setMediaSize(const QSize &size) |
(since QXmpp 1.1) void | setMediaSources(const QVector<QXmppDataForm::MediaSource> &mediaSources) |
| void | setOptions(const QList<QPair<QString, QString>> &options) |
| void | setRequired(bool required) |
| void | setType(QXmppDataForm::Field::Type type) |
| void | setValue(const QVariant &value) |
| QXmppDataForm::Field::Type | type() const |
| QVariant | value() const |
| QXmppDataForm::Field & | operator=(QXmppDataForm::Field &&) |
| QXmppDataForm::Field & | operator=(const QXmppDataForm::Field &other) |
(since QXmpp 1.1) bool | operator==(const QXmppDataForm::Field &other) const |
Detailed Description
The QXmppDataForm::Field class represents a data form field as defined by XEP-0004: Data Forms.
Member Function Documentation
[since QXmpp 1.3] Field::Field(QXmppDataForm::Field::Type type = TextSingleField, const QString &key = {}, const QVariant &value = {}, bool isRequired = false, const QString &label = {}, const QString &description = {}, const QList<QPair<QString, QString>> &options = {})
Constructs a QXmppDataForm::Field with the specified attributes.
This function was introduced in QXmpp 1.3.
Field::Field(const QXmppDataForm::Field &other)
Constructs a copy of other.
Field::Field(QXmppDataForm::Field &&)
Default move constructor.
[noexcept] Field::~Field()
Destroys the form field.
QString Field::description() const
Returns the field's description.
See also setDescription().
bool Field::isRequired() const
Returns true if the field is required, false otherwise.
QString Field::key() const
Returns the field's key.
See also setKey().
QString Field::label() const
Returns the field's label.
See also setLabel().
[since QXmpp 1.1] QSize Field::mediaSize() const
Returns the size of the attached media according to XEP-0221: Data Forms Media Element.
This function was introduced in QXmpp 1.1.
See also setMediaSize().
[since QXmpp 1.1] QVector<QXmppDataForm::MediaSource> Field::mediaSources() const
Returns the sources for the attached media according to XEP-0221: Data Forms Media Element.
This function was introduced in QXmpp 1.1.
See also setMediaSources().
QList<QPair<QString, QString>> Field::options() const
Returns the field's options.
See also setOptions().
void Field::setDescription(const QString &description)
Sets the field's description.
See also description().
void Field::setKey(const QString &key)
Sets the field's key.
See also key().
void Field::setLabel(const QString &label)
Sets the field's label.
See also label().
[since QXmpp 1.1] void Field::setMediaSize(const QSize &size)
Sets the size of the attached media according to XEP-0221: Data Forms Media Element.
size.
This function was introduced in QXmpp 1.1.
See also mediaSize().
[since QXmpp 1.1] void Field::setMediaSources(const QVector<QXmppDataForm::MediaSource> &mediaSources)
Sets the sources to the attached media of the field according to XEP-0221: Data Forms Media Element.
mediaSources.
This function was introduced in QXmpp 1.1.
See also mediaSources().
void Field::setOptions(const QList<QPair<QString, QString>> &options)
Sets the field's options.
See also options().
void Field::setRequired(bool required)
Sets required to true if the field is required, false otherwise.
See also isRequired().
void Field::setType(QXmppDataForm::Field::Type type)
Sets the field's type.
See also type().
void Field::setValue(const QVariant &value)
Sets the field's value.
See also value().
QXmppDataForm::Field::Type Field::type() const
Returns the field's type.
See also setType().
QVariant Field::value() const
Returns the field's value.
See also setValue().
QXmppDataForm::Field &Field::operator=(QXmppDataForm::Field &&)
Default move-assignment operator.
QXmppDataForm::Field &Field::operator=(const QXmppDataForm::Field &other)
Assigns other to this field.
[since QXmpp 1.1] bool Field::operator==(const QXmppDataForm::Field &other) const
Returns true if other is identical to this field.
This function was introduced in QXmpp 1.1.