Person.hpp Example File
persistentobjects/src/Person.hpp
#ifndef PERSON_HPP
#define PERSON_HPP
#include <QObject>
class Person: public QObject
{
Q_OBJECT
Q_PROPERTY(QString customerID READ customerID WRITE setCustomerID NOTIFY customerIDChanged FINAL)
Q_PROPERTY(QString firstName READ firstName WRITE setFirstName NOTIFY firstNameChanged FINAL)
Q_PROPERTY(QString lastName READ lastName WRITE setLastName NOTIFY lastNameChanged FINAL)
public:
Person(QObject *parent = 0);
Person(const QString &id, const QString &firstname, const QString &lastname, QObject *parent = 0);
bool operator==(Person *person) const;
QString customerID() const;
QString firstName() const;
QString lastName() const;
void setCustomerID(const QString &newId);
void setFirstName(const QString &newName);
void setLastName(const QString &newName);
Q_SIGNALS:
void customerIDChanged(const QString &newId);
void firstNameChanged(const QString &firstName);
void lastNameChanged(const QString &lastName);
private:
QString m_id;
QString m_firstName;
QString m_lastName;
};
#endif