generated C++ code

#include <QObject>

#include <functional>

template <typename T>
struct PropertyValue {
    enum Type {
        Value,
        Binding
    };
    Type type;
    T value;
    std::function<T()> binding;

    inline void setValue(T value) {
        this->value = value;
        this->type  = Type::Value;
    }

    inline void setBinding(const std::function<T()> &binding) {
        this->binding = binding;
        this->type    = Type::Binding;
    }

    inline T getContent() {
        switch (type) {
        case Value:
            return value;
        case Binding:
            return binding();
        }
    }
};


class Main : public QObject {
    Q_OBJECT
    
public:
    Main(QObject *parent = nullptr) : QObject(parent) {
    }
    ~Main() {}
    Q_PROPERTY(int n READ n WRITE setN NOTIFY nChanged READONLY)

    Q_PROPERTY(int nPlusOne READ nPlusOne WRITE setNPlusOne NOTIFY nPlusOneChanged )

    Q_PROPERTY(int quadN READ quadN WRITE setQuadN NOTIFY quadNChanged )

    inline int n() {
        return m_n.getContent();
    };
    inline void setN(int value) {
        m_n.setValue(value);
        Q_EMIT nChanged();
    };
    inline void setN(const std::function<int()> &binding, const std::vector<void(*)()> signalsUsedInBinding) {
        m_n.setBinding(binding);
        Q_EMIT nChanged();
    };
    Q_SIGNAL void nChanged();
    PropertyValue<int> m_n;

    inline int nPlusOne() {
        return m_nPlusOne.getContent();
    };
    inline void setNPlusOne(int value) {
        m_nPlusOne.setValue(value);
        Q_EMIT nPlusOneChanged();
    };
    inline void setNPlusOne(const std::function<int()> &binding, const std::vector<void(*)()> signalsUsedInBinding) {
        m_nPlusOne.setBinding(binding);
        Q_EMIT nPlusOneChanged();
    };
    Q_SIGNAL void nPlusOneChanged();
    PropertyValue<int> m_nPlusOne;

    inline int quadN() {
        return m_quadN.getContent();
    };
    inline void setQuadN(int value) {
        m_quadN.setValue(value);
        Q_EMIT quadNChanged();
    };
    inline void setQuadN(const std::function<int()> &binding, const std::vector<void(*)()> signalsUsedInBinding) {
        m_quadN.setBinding(binding);
        Q_EMIT quadNChanged();
    };
    Q_SIGNAL void quadNChanged();
    PropertyValue<int> m_quadN;

};