myinputpanelcontext.h
785 Bytes
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
#ifndef MYINPUTPANELCONTEXT_H
#define MYINPUTPANELCONTEXT_H
#include <QInputContext>
//#include "myinputpanel.h"
class MyInputPanel;
class MyInputPanelContext : public QInputContext
{
Q_OBJECT
public:
MyInputPanel *inputPanel;
MyInputPanelContext();
~MyInputPanelContext();
//输入事件过滤
bool filterEvent(const QEvent* event);
//返回输入方式的识别码
QString identifierName();
//返回输入编码方式
QString language();
//输入是否发送完
bool isComposing() const;
void reset();
private slots://发送接收到的字符到有光标焦点的窗口
void sendCharacter(QChar character);
private://更新软键盘位置
void updatePosition();
private:
};
#endif // MYINPUTPANELCONTEXT_H