-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShuttleHelper.h
51 lines (43 loc) · 1.44 KB
/
ShuttleHelper.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
#ifndef SHUTTLEHELPER_H
#define SHUTTLEHELPER_H
#include <QWidget>
#include <QVector>
#include <QQueue>
typedef struct _SHUTTLE_DATA_
{
QVector<QWidget*> shuttleVec;
QVector<QWidget*>::const_iterator shuttleIter;
}ShuttleDate;
class ShuttleHelper : public QObject
{
Q_OBJECT
public:
static ShuttleHelper& Instance();
static void Construct(QObject *parent = nullptr);
static void Destruct();
void PopTopWindow();
void RegeisterNewWindow(QVector<QWidget*>, QWidget*);
void RegeisterVoidTop();
void UpdateTopWindow(QVector<QWidget*>, QWidget*);
void UpdateMainWindow(QVector<QWidget*>, QWidget*);
void UpdateTopWinIter(QWidget *);
void SetAdjustFlag(bool flag = true);
void SetClickFlag();
public slots:
void onLeft();
void onRight();
void onEnter();
private:
explicit ShuttleHelper(QObject *parent = nullptr);
virtual ~ShuttleHelper();
ShuttleHelper(ShuttleHelper& ) = delete;
ShuttleHelper(ShuttleHelper&&) = delete;
ShuttleHelper& operator=(const ShuttleHelper& ) = delete;
ShuttleHelper& operator=(const ShuttleHelper&&) = delete;
private:
static ShuttleHelper *s_instance;
bool m_adjustFlag; // 调节标志 false改变光标位置 true为选中并调节
bool m_clickFlag; // 默认false 转动编码器后置为true 焦点出现
QQueue<ShuttleDate> m_shuttleQueue;
};
#endif // SHUTTLEHELPER_H