#ifndef POSEXTENDOBJECT_H
#define POSEXTENDOBJECT_H

#include <QObject>
#include <QJsonObject>
#include <QVariant>
#include <QMetaProperty>

class PosExtendObject : public QObject
{
    Q_OBJECT
    Q_PROPERTY (QString printType READ getPrintType WRITE setPrintType)
    Q_PROPERTY (int qty READ getQty WRITE setQty)
    Q_PROPERTY (QString printName READ getPrintName WRITE setPrintName)
    Q_PROPERTY (QString printDesc READ getPrintDesc WRITE setPrintDesc)

public:
    explicit PosExtendObject(QObject *parent = 0):QObject(parent){}
    PosExtendObject(const PosExtendObject& posExtendObj,QObject* parent=0);
    PosExtendObject& operator =(const PosExtendObject& posExtendObj);
    void FetchDataFromJson(const QJsonObject &json);
    QString objectToString();

    QString printType;
    int qty = 0;
    QString printName;
    QString printDesc;

protected:
    inline QString getPrintType(){ return printType; }
    inline void setPrintType(const QString& v){ printType = v; }

    inline int getQty(){ return qty; }
    inline void setQty(const int& v){ qty = v; }

    inline QString getPrintName(){ return printName; }
    inline void setPrintName(const QString& v){ printName = v; }

    inline QString getPrintDesc(){ return printDesc; }
    inline void setPrintDesc(const QString& v){ printDesc = v; }
};

#endif // POSEXTENDOBJECT_H
