Herunterladen als
root/samples/example/models/group.h @ 59e17af2
b7446f4c | Christian Ehringfeld | #ifndef GROUP_H
|
|
#define GROUP_H
|
|||
#include "entity.h"
|
|||
#include <QDebug>
|
|||
class Teacher;
|
|||
class Person;
|
|||
class Pupil;
|
|||
class Relation;
|
|||
using namespace CuteEntityManager;
|
|||
class Group: public CuteEntityManager::Entity {
|
|||
Q_OBJECT
|
|||
37d98e0b | Christian Ehringfeld | EM_MACRO(Group)
|
|
da565582 | Christian Ehringfeld | Q_PROPERTY(QList<QSharedPointer<Pupil>> pupils READ getPupils WRITE setPupils)
|
|
af84b9c4 | Christian Ehringfeld | Q_PROPERTY(QList<QSharedPointer<Person>> persons READ getPersons WRITE
|
|
setPersons)
|
|||
b7446f4c | Christian Ehringfeld | Q_PROPERTY(QString name READ getName WRITE setName)
|
|
Q_PROPERTY(QSharedPointer<Person> mainTeacher READ getMainTeacher WRITE
|
|||
setMainTeacher)
|
|||
public:
|
|||
Q_INVOKABLE Group();
|
|||
af84b9c4 | Christian Ehringfeld | const QHash<QString, CuteEntityManager::Relation> getRelations() const override;
|
|
b7446f4c | Christian Ehringfeld | ||
QString getName() const;
|
|||
void setName(const QString &value);
|
|||
QList<QSharedPointer<Pupil> > getPupils() const;
|
|||
void setPupils(const QList<QSharedPointer<Pupil> > &value);
|
|||
void addPupil(Pupil *pupil);
|
|||
QSharedPointer<Pupil> pupilAt(int i);
|
|||
QSharedPointer<Person> getMainTeacher() const;
|
|||
void setMainTeacher(const QSharedPointer<Person> &value);
|
|||
abb9e8c5 | Christian Ehringfeld | QList<QSharedPointer<Person> > getPersons() const;
|
|
void addPerson(Person *person);
|
|||
void setPersons(const QList<QSharedPointer<Person> > &value);
|
|||
af84b9c4 | Christian Ehringfeld | protected:
|
|
b7446f4c | Christian Ehringfeld | QList<QSharedPointer<Pupil>> pupils;
|
|
abb9e8c5 | Christian Ehringfeld | QList<QSharedPointer<Person>> persons;
|
|
b7446f4c | Christian Ehringfeld | QSharedPointer<Person> mainTeacher;
|
|
QString name;
|
|||
};
|
|||
#endif // GROUP_H
|