-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaincontroller.h
More file actions
56 lines (42 loc) · 1.16 KB
/
maincontroller.h
File metadata and controls
56 lines (42 loc) · 1.16 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
50
51
52
53
54
55
56
#ifndef MAINCONTROLLER_H
#define MAINCONTROLLER_H
#include <QObject>
#include <QMainWindow>
#include <QList>
#include "QuwiAPI/quwiproject.h"
class QuwiAPI;
class QStandardItemModel;
class QSignalMapper;
class QQmlApplicationEngine;
class QQuickItem;
class MainController : public QObject
{
Q_OBJECT
public:
explicit MainController(QObject *parent = nullptr);
void setEngine(QQmlApplicationEngine *engine);
void getProjects();
private slots:
void cleanWarningMessage();
void login(QString, QString);
void loginSucced();
void loginFailed(QString);
void logout();
void logoutSucced();
void projectsReceived(QList<QuwiProject>*);
void updateProjectName(int id, QString newName);
void updateSucced(QString);
void apiCallError(QString);
void updateWarningMessage(QString msg);
signals:
void updateProject(int);
private:
QQmlApplicationEngine *mEngine;
QQuickItem *mLoginView;
QQuickItem *mProjectsView;
QuwiAPI *mAPI;
QList<QuwiProject> *mProjectList;
QStandardItemModel *mModel;
QSignalMapper *mSignalMapper; //is used to set id for each button in table
};
#endif // MAINCONTROLLER_H