00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __STAFF_MODEL_H
00022 #define __STAFF_MODEL_H
00023
00024 #include <QModelIndex>
00025 #include <QVariant>
00026
00027 #include "sql.h"
00028
00029 #include "RootModel.h"
00030 #include "RootItem.h"
00031 #include "InstItem.h"
00032 #include "FacItem.h"
00033 #include "DeptItem.h"
00034 #include "StaffItem.h"
00035
00036 #include "DataClass.h"
00037
00038 class InstItem;
00039
00040 class StaffModel : public RootModel
00041 {
00042 Q_OBJECT
00043
00044 public:
00045
00046 StaffModel(dbListManager * dataLists
00047 ,DataClass::ClassName cn=DataClass::DATA_CLASS
00048 ,RootItem * root=0
00049 ,QObject *parent = 0
00050 );
00051 ~StaffModel(){};
00052
00053
00054 int columnCount(const QModelIndex &parent) const;
00055 QVariant headerData(int section, Qt::Orientation orientation,
00056 int role = Qt::DisplayRole) const;
00057
00058 private:
00059 inline virtual void setupData(dbListManager &dataLists,RootItem * parent)
00060 {setupData(dataLists, DataClass::DATA_CLASS, parent);}
00061 void setupData(dbListManager &dataLists
00062 ,DataClass::ClassName cn
00063 ,RootItem * parent
00064 );
00065 void setupInstData(dbListManager &dataLists, RootItem * parent);
00066 void setupFacultyData(dbListManager &dataLists, InstItem * parent);
00067 void setupDeptData(dbListManager &dataLists, FacItem * parent);
00068 void setupStaffData(dbListManager &dataLists, DeptItem * parent);
00069 void setupInstStaffData(dbListManager &dataLists, InstItem * parent);
00070 };
00071
00072 #endif