QStandardItemModel & binding to custom object
问题 I tried to use the cities-standarditem of the Qt exemple and adapt it to my exemple. I have a strange result: Here is my User class: class User{ public: User(); QString getFirstname() const; void setFirstname(const QString &value); QString getLastname() const; void setLastname(const QString &value); int getAge() const; void setAge(int value); private: QString firstname; QString lastname; int age; }; and i have declared a usermodel.h: class UserModel: public QStandardItemModel { Q_OBJECT