iFacility  1.0
Проект является реализацией ИС "Предприятие"
userprofessionviewmodel.h
Go to the documentation of this file.
1 #ifndef USERPROFESSIONVIEWMODEL_H
2 #define USERPROFESSIONVIEWMODEL_H
3 
4 #include <QAbstractTableModel>
5 #include <QFont>
6 
7 #include "../objects/user.h"
8 #include "../db/database.h"
9 
14 class UserProfessionViewModel : public QAbstractTableModel {
15 private:
16  Q_OBJECT
17 
23  User *mUser = nullptr;
24 
25 public:
31  UserProfessionViewModel(QObject *parent);
32 
39  int rowCount(const QModelIndex &parent = QModelIndex()) const;
46  int columnCount(const QModelIndex &parent = QModelIndex()) const;
55  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
63  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
64 
70  void setUser(User *user);
75  void invalidateData();
76 };
77 
78 #endif // USERPROFESSIONVIEWMODEL_H
Класс сущности пользователя
Definition: user.h:26
ViewModel для таблицы профессий пользователя
Definition: userprofessionviewmodel.h:14
int rowCount(const QModelIndex &parent=QModelIndex()) const
Возвращает кол-во строк в таблице
Definition: userprofessionviewmodel.cpp:7
QVariant headerData(int section, Qt::Orientation orientation, int role) const
Возвращает содержимое заголовка таблицы
Definition: userprofessionviewmodel.cpp:15
void invalidateData()
Запускает перерисовку таблицы
Definition: userprofessionviewmodel.cpp:65
UserProfessionViewModel(QObject *parent)
Стандартный конструктор объекта класса
Definition: userprofessionviewmodel.cpp:3
void setUser(User *user)
Устанавливает пользователя, профессии которые будут отображаться
Definition: userprofessionviewmodel.cpp:60
int columnCount(const QModelIndex &parent=QModelIndex()) const
Возвращает кол-во столбцов в таблице
Definition: userprofessionviewmodel.cpp:11
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Возвращает содержимое ячеек таблицы
Definition: userprofessionviewmodel.cpp:30