Revision af84b9c4
Von Christian Ehringfeld vor mehr als 10 Jahren hinzugefügt
| samples/example/models/group.h | ||
|---|---|---|
|
#ifndef GROUP_H
|
||
|
#define GROUP_H
|
||
|
|
||
|
#include "entity.h"
|
||
|
#include "contact.h"
|
||
|
#include "pupil.h"
|
||
|
#include <QDebug>
|
||
|
//#include <QQuickView>
|
||
|
|
||
|
|
||
|
|
||
|
class Teacher;
|
||
|
class Person;
|
||
| ... | ... | |
|
class Group: public CuteEntityManager::Entity {
|
||
|
Q_OBJECT
|
||
|
Q_PROPERTY(QList<QSharedPointer<Pupil>> pupils READ getPupils WRITE setPupils)
|
||
|
Q_PROPERTY(QList<QSharedPointer<Person>> persons READ getPersons WRITE setPersons)
|
||
|
Q_PROPERTY(QList<QSharedPointer<Person>> persons READ getPersons WRITE
|
||
|
setPersons)
|
||
|
Q_PROPERTY(QString name READ getName WRITE setName)
|
||
|
Q_PROPERTY(QSharedPointer<Person> mainTeacher READ getMainTeacher WRITE
|
||
|
setMainTeacher)
|
||
|
|
||
|
public:
|
||
|
Q_INVOKABLE Group();
|
||
|
virtual const QHash<QString, CuteEntityManager::Relation> getRelations() const;
|
||
|
const QHash<QString, CuteEntityManager::Relation> getRelations() const override;
|
||
|
|
||
|
QString getName() const;
|
||
|
void setName(const QString &value);
|
||
| ... | ... | |
|
void addPerson(Person *person);
|
||
|
void setPersons(const QList<QSharedPointer<Person> > &value);
|
||
|
|
||
|
protected:
|
||
|
protected:
|
||
|
QList<QSharedPointer<Pupil>> pupils;
|
||
|
QList<QSharedPointer<Person>> persons;
|
||
|
QSharedPointer<Person> mainTeacher;
|
||
Auch abrufbar als: Unified diff
example update