-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeyboard.h
35 lines (28 loc) · 851 Bytes
/
keyboard.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
#ifndef KEYBOARD_H
#define KEYBOARD_H
#include <QObject>
class Keyboard : public QObject
{
Q_OBJECT
Q_PROPERTY(quint32 characterIndex READ characterIndex WRITE setCharacterIndex NOTIFY characterIndexChanged)
Q_PROPERTY(bool show READ show NOTIFY showChanged)
private:
static const QString CHARACTERS;
bool m_show;
double m_characterIndex;
private:
explicit Keyboard(QObject *parent = nullptr);
public:
static Keyboard* instance();
static double getCharacterIndex(double characterIndex);
quint32 characterIndex();
void setCharacterIndex(double characterIndex);
void incCharacterIndex(double delta);
Q_INVOKABLE QChar getCharacterAt(qint32 characterIndex);
bool show();
void setShow(bool show);
signals:
void characterIndexChanged();
void showChanged();
};
#endif // KEYBOARD_H