Account Table and form update, add edit and add function .
This commit is contained in:
@@ -4,21 +4,45 @@
|
||||
|
||||
#ifndef GUI_ACCOUNTFORMDIALOG_H
|
||||
#define GUI_ACCOUNTFORMDIALOG_H
|
||||
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QSqlTableModel;
|
||||
#include "GUIFormBaseDialog.h"
|
||||
|
||||
enum AccountEditMode{
|
||||
Self, Admin, New
|
||||
};
|
||||
class AccountFormDialog:public GUIFormBaseDialog{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AccountFormDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
explicit AccountFormDialog(QWidget *parent = nullptr,AccountEditMode mode = Self,Qt::WindowFlags f = Qt::WindowFlags());
|
||||
~AccountFormDialog();
|
||||
void setAccountInformation(const QMap<QString,QVariant>& values);
|
||||
void setReferenceModel(QSqlTableModel* model){
|
||||
refmodel = model;
|
||||
}
|
||||
protected:
|
||||
bool updateReferenceData() override;
|
||||
void warn(QString msg);
|
||||
void hideWarn();
|
||||
private:
|
||||
QString m_UserID;
|
||||
QString m_UserPwd;
|
||||
QString m_RoleID;
|
||||
QString m_NewUserName;
|
||||
bool userNameChanged = false;
|
||||
bool commentChanged = false;
|
||||
bool roleChanged = false;
|
||||
AccountEditMode m_mode = Self;
|
||||
QLineEdit* le_UserCode = nullptr;
|
||||
QLineEdit* le_UserName = nullptr;
|
||||
QLineEdit* le_Comment = nullptr;
|
||||
QLineEdit* le_Pwd = nullptr;
|
||||
QPushButton* btn_Pwd = nullptr;
|
||||
QPushButton* btn_Role = nullptr;
|
||||
QLabel* lbl_error = nullptr;
|
||||
QSqlTableModel* refmodel = nullptr;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user