mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
78 lines
1.6 KiB
C++
78 lines
1.6 KiB
C++
#ifndef COMMONVIEW_H
|
|
#define COMMONVIEW_H
|
|
|
|
#include <QTreeWidget>
|
|
#include <QTranslator>
|
|
#include <QMutex>
|
|
#include "instructorsAndTrainees_global.h"
|
|
#include "connectortoserver.h"
|
|
|
|
//Родительский класс представления БД Инструкторов/Обучаемых (самого верхнего уровня)
|
|
|
|
class CommonView : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum TypeView
|
|
{
|
|
onlyView,
|
|
control
|
|
};
|
|
|
|
enum TypeObject
|
|
{
|
|
objInstructor,
|
|
objTrainee,
|
|
objGroup
|
|
};
|
|
|
|
public:
|
|
CommonView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent = nullptr);
|
|
|
|
public:
|
|
void setAdminMode(bool adminMode)
|
|
{
|
|
this->adminMode = adminMode;
|
|
}
|
|
void setAuthComplited(bool authComplited)
|
|
{
|
|
this->authComplited = authComplited;
|
|
}
|
|
|
|
protected:
|
|
void setArchiveVisible(bool archiveVisible)
|
|
{
|
|
this->archiveVisible = archiveVisible;
|
|
}
|
|
void setNotLoggedInVisible(bool notLoggedInVisible)
|
|
{
|
|
this->notLoggedInVisible = notLoggedInVisible;
|
|
}
|
|
|
|
void setItemColorArchive(QTreeWidgetItem* item);
|
|
void setItemColorNoArchive(QTreeWidgetItem* item);
|
|
|
|
void setItemColor(QTreeWidgetItem* item, QColor color);
|
|
|
|
public:
|
|
void updateMyStyleSheet();
|
|
|
|
private:
|
|
QString loadStyleSheet();
|
|
|
|
protected:
|
|
ConnectorToServer* connectorToServer;
|
|
QTreeWidget* treeWidget;
|
|
QMutex mtxTreeWidget;
|
|
TypeView typeView;
|
|
bool archiveVisible;
|
|
bool notLoggedInVisible;
|
|
bool adminMode;
|
|
bool authComplited;
|
|
int lastCurrentID;
|
|
TypeObject typeObject;
|
|
};
|
|
|
|
#endif // COMMONVIEW_H
|