-
Notifications
You must be signed in to change notification settings - Fork 2
/
appcontroller.h
58 lines (40 loc) · 1.27 KB
/
appcontroller.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
#ifndef APPCONTROLLER_H
#define APPCONTROLLER_H
#include <QObject>
#include <QStateMachine>
#include "state.h"
class AppController : public QObject {
Q_OBJECT
Q_PROPERTY(QObject *stateMachine READ stateMachine CONSTANT)
Q_PROPERTY(QObject *firstState READ firstState CONSTANT)
Q_PROPERTY(QObject *secondState READ secondState CONSTANT)
Q_PROPERTY(QObject *thirdState READ thirdState CONSTANT)
Q_PROPERTY(bool pop READ pop WRITE setPop)
public:
explicit AppController(QObject *parent = 0);
QStateMachine *stateMachine() const { return m_stateMachine; }
State *firstState() const { return m_firstState; }
State *secondState() const { return m_secondState; }
State *thirdState() const { return m_thirdState; }
bool pop() const { return m_pop; }
void setPop(bool pop) {
if (pop != m_pop) {
m_pop = pop;
}
}
Q_INVOKABLE void navPrevious();
Q_INVOKABLE void navNext();
private:
QStateMachine *m_stateMachine;
State *m_firstState;
State *m_secondState;
State *m_thirdState;
bool m_pop;
void initStateMachine();
signals:
void stateChanged(QString objectName);
void navigateForward(void);
void navigateBackward(void);
public slots:
};
#endif // APPCONTROLLER_H