-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.h
More file actions
49 lines (39 loc) · 1.1 KB
/
server.h
File metadata and controls
49 lines (39 loc) · 1.1 KB
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
#ifndef SERVER_H
#define SERVER_H
#include <QObject>
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <QtCharts/QDateTimeAxis>
#include <QtCharts/QCategoryAxis>
#include <QDateTime>
//#include <QtSql/QSqlDatabase>
#include <QtSql>
#include <memory>
using namespace QtCharts;
static QDateTimeAxis xValue;
class Server : public QObject
{
Q_OBJECT
QString m_username=(NULL);
QString hostname,database;
int port;
Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged)
QSqlDatabase db;
public:
explicit Server(QObject *parent = 0);
~Server();
QString username() const;
void setUsername(QString username){
m_username=username;
emit usernameChanged(username);
}
Q_INVOKABLE void setDatabase(QString,QString,int);
Q_INVOKABLE void setLineSeries(QLineSeries* lineSeries);
Q_INVOKABLE float queryLatest(QString qry);
Q_INVOKABLE QDateTimeAxis* getAxisXTime();
Q_INVOKABLE bool authenticate(QString password);
signals:
void usernameChanged(QString);
public slots:
};
#endif // SERVER_H