5#ifndef QXMPPDATAFORMBASED_H
6#define QXMPPDATAFORMBASED_H
8#include "QXmppDataForm.h"
26 std::optional<quint32>
parseUInt(
const QVariant &variant)
29 if (
const auto result = variant.toString().toUInt(&ok); ok) {
38 if (
const auto result = variant.toString().toULongLong(&ok); ok) {
44 std::optional<bool>
parseBool(
const QVariant &variant)
46 if (variant.type() == QVariant::Bool) {
47 return variant.toBool();
61 if (!value.isNull()) {
62 serializeValue(form, type, name.toString(), value);
69 if (!value.isEmpty()) {
70 serializeValue(form, type, name.toString(), value);
74 template<
typename T,
typename ValueConverter = T (*)(T)>
78 if (optional.has_value()) {
79 serializeValue(form, type, name.toString(), convert(*optional));
86 if (optional.has_value()) {
87 serializeValue(form, type, name.toString(), QString::number(*optional));
94class QXmppExtensibleDataFormBasePrivate;
109 QList<QXmppDataForm::Field> unknownFields()
const;
110 void setUnknownFields(
const QList<QXmppDataForm::Field> &unknownFields);
119 QSharedDataPointer<QXmppExtensibleDataFormBasePrivate> d;