-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
138 lines (97 loc) · 2.68 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
//windows
#include <qsqlconnectiondialog.h>
#include <additemdialog.h>
#include <responsewidget.h>
#include <respopup.h>
#include <adduser.h>
#include <edit.h>
//...
//Models
#include <sortfilterproxymodel.h>
#include <tablemodel.h>
#include <checkboxdelegate.h>
//...
#include <QtSql>
#include <QtWidgets>
#include <QMessageBox>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
Q_PROPERTY(Role role READ role WRITE setRole NOTIFY roleChanged)
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
enum Role{
None=0,
Admin,
Salesman_Storekeeper,
Salesman,
Storekeeper
};
Q_ENUM(Role)
Role role() const
{ return m_role; }
void setRole(Role role)
{
m_role=role;
emit roleChanged(role);
}
Role getRole(QString);
QString activeDb() const
{ return dbName; }
void setDbName(QString name)
{
dbName=name;
}
QSqlError addConnection(const QString &driver, const QString &dbName, const QString &host,
const QString &user, const QString &passwd, int port = -1);
void setStatusState();
public slots:
void customizeWindowRole(Role);
void addConnection();
void statusMessage(const QString str);
signals:
void roleChanged(Role);
private slots:
void showResponseWindow(QModelIndex);
void on_add_item_clicked();
void on_recieved_clicked();
void on_filterEdit_textChanged(const QString &arg1);
void on_dateTimeEdit_dateTimeChanged(const QDateTime &dateTime);
void on_dateTimeEdit_2_dateTimeChanged(const QDateTime &dateTime);
void on_picking_clicked();
void on_ready_to_delivery_clicked();
void on_delivered_clicked();
void on_response_clicked();
void on_table_doubleClicked(const QModelIndex &index);
void on_refresh_clicked();
void on_deleteRowAction_triggered();
void on_deleteRowAction_2_triggered();
void on_add_user_clicked();
void on_autorefresh_clicked(bool checked);
void on_actionCheckUncheckAll_triggered(bool checked);
void on_actionEdit_triggered();
private:
Ui::MainWindow *ui;
QString dbName;
//Models
SortFilterProxyModel *proxyModel;
tableModel *relTableModel;
CheckBoxDelegate *checkDelegate;
//...
//Dialogs
qsqlconnectiondialog dialog;
resPopUp resPop;
//...
//Roles
Role m_role;
//...
QTimer *timer;
};
#endif // MAINWINDOW_H