Projekt

Allgemein

Profil

Herunterladen als
Herunterladen (2,68 KB) Statistiken
| Zweig: | Revision:
9d05e414 Christian Ehringfeld
#ifndef GROUP_H
#define GROUP_H

#include "models/person.h"
//#include <QQmlListProperty>
#include <QDebug>
#include <QList>
#include <QVariantList>
//#include <QQuickView>
a47954c0 Christian Ehringfeld
#include "artikel.h"
9c2f773f Christian Ehringfeld
#include <QSharedPointer>
9d05e414 Christian Ehringfeld


class SeatingPlan;
class Teacher;
class Person;
a47954c0 Christian Ehringfeld
class Relation;
9d05e414 Christian Ehringfeld
class Group: public CuteEntityManager::Entity {
Q_OBJECT
//Q_ENUMS(Gender)
//Q_PROPERTY(QList<Person*> persons READ getPersons)

// Q_PROPERTY(QList<Person*> persons READ get_persons WRITE set_persons RESET reset_persons)
// BR_PROPERTY(QList<Person*>, persons, QList<Person*>())
Q_PROPERTY(QList<Person*> persons READ getPersons WRITE setPersons NOTIFY personsChanged)
586bb527 Christian Ehringfeld
Q_PROPERTY(Person* teacher READ getTeacher WRITE setTeacher)
Q_PROPERTY(QSharedPointer<Person> teacherP READ getTeacherP WRITE setTeacherP)
a47954c0 Christian Ehringfeld
Q_PROPERTY(QSharedPointer<Artikel> artikel READ getArtikel WRITE setArtikel)
9d05e414 Christian Ehringfeld
signals:
void personsChanged();

public slots:
void personChangedSlot();

public:
a47954c0 Christian Ehringfeld
virtual QHash<QString, CuteEntityManager::Relation> getRelations();
9d05e414 Christian Ehringfeld
// constructor
Group();

// getters
// QQmlListProperty <Person> persons();


// static void appendPerson(QQmlListProperty<Person> *list, Person *p);
// static int personsCount(QQmlListProperty<Person>*list);
// static Person* personAt(QQmlListProperty<Person> *list, int i);
// static void personsClear(QQmlListProperty<Person> *list);

QList <Person *> classPrefects() {
return m_classPrefects;
}
QList <Person *> parentSpeakers() {
return m_parentSpeakers;
}

// setters
void removePerson(Person *p) {
persons.removeOne(p);
}
void addClassPrefect(Person *p) {
m_classPrefects.append(p);
}
void removeClassPrefect(Person *p) {
m_classPrefects.removeOne(p);
}
void addParentSpeaker(Person *p) {
m_parentSpeakers.append(p);
}
void removeParentSpeaker(Person *p) {
m_parentSpeakers.removeOne(p);
}

void addPerson(Person *p) {
persons.append(p);
}

QList<Person *> getPersons() const;
void setPersons(const QList<Person *> &value);

586bb527 Christian Ehringfeld
QSharedPointer<Person> getTeacherP() const;
void setTeacherP(const QSharedPointer<Person> &value);

Person *getTeacher() const;
void setTeacher(Person *value);

a47954c0 Christian Ehringfeld
QSharedPointer<Artikel> getArtikel() const;
void setArtikel(const QSharedPointer<Artikel> &value);

9d05e414 Christian Ehringfeld
protected:
// members
586bb527 Christian Ehringfeld
Person* teacher;
QSharedPointer<Person> teacherP;
9d05e414 Christian Ehringfeld
QList<Person*> persons;
a47954c0 Christian Ehringfeld
QSharedPointer<Artikel> artikel;
9d05e414 Christian Ehringfeld
QList <Person *> m_classPrefects;
QList <Person *> m_parentSpeakers;

// PersonListModel* m_personListModel;
};
#endif // GROUP_H