5#ifndef QXMPPDATAFORMBASED_H
6#define QXMPPDATAFORMBASED_H
8#include "QXmppDataForm.h"
28 std::optional<quint32>
parseUInt(
const QVariant &variant)
31 if (
const auto result = variant.toString().toUInt(&ok); ok) {
40 if (
const auto result = variant.toString().toULongLong(&ok); ok) {
46 std::optional<bool>
parseBool(
const QVariant &variant)
48 if (variant.type() == QVariant::Bool) {
49 return variant.toBool();
63 if (!value.isNull()) {
64 serializeValue(form, type, name, value);
71 if (!value.isEmpty()) {
72 serializeValue(form, type, name, value);
76 template<
typename T,
typename ValueConverter = T (*)(T)>
80 if (optional.has_value()) {
81 serializeValue(form, type, name, convert(*optional));
88 if (optional.has_value()) {
89 serializeValue(form, type, name, QString::number(*optional));
96class QXmppExtensibleDataFormBasePrivate;
111 QList<QXmppDataForm::Field> unknownFields()
const;
112 void setUnknownFields(
const QList<QXmppDataForm::Field> &unknownFields);
121 QSharedDataPointer<QXmppExtensibleDataFormBasePrivate> d;