#ifndef USLIST_H #define USLIST_H #include #include #define US_LIST(TYPE, NAME) \ Q_PROPERTY(QList NAME READ NAME WRITE NAME NOTIFY NAME ## Changed) \ public: \ QList NAME() const { return _ ## NAME; } \ void NAME(QList value) { \ if(_ ## NAME == value)return; \ _ ## NAME.clear(); \ for(int i = 0; i < value.length(); i++) \ { \ _ ## NAME.append(value[i]); \ } \ emit NAME ## Changed(value); \ send(); \ } \ Q_SIGNAL void NAME ## Changed(QList value); \ private: \ QList _ ## NAME; \ #endif //USLIST_H