myinputpanel.h
1.42 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
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef MYINPUTPANEL_H
#define MYINPUTPANEL_H
#include <QtGui>
#include <QWidget>
#include <QDebug>
#include "mainwindow.h"
extern QString globaldata;
namespace Ui {
class MyInputPanel;
}
class MyInputPanel : public QWidget
{
Q_OBJECT
public:
Ui::MyInputPanel *ui;
MyInputPanel();
QWidget *getFocusedWidget();//获取有光标且需要输入的窗口指针
void clearLineEditData();
signals:
void characterGenerated(QChar character);//字符产生,每个按键都要对应一个ASCII
protected://事件处理函数,这里只处理窗口激活事件,其它事件lfyw
bool event(QEvent *e);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *event);
private slots://保存上次要输入窗口的指针
void saveFocusWidget(QWidget *oldFocus, QWidget *newFocus);
void buttonClicked(QWidget *w);
void mapDataLineEdit(); //映射当前窗口输入的数据
void on_panelButton_Point_clicked();
void on_panelButton_FU_clicked();
private:
void keyMapping();
void setbutton(int type);
void testAndsend(QChar chr);
void Modifier(QChar chr);
QWidget *lastFocusedWidget;
QSignalMapper signalMapper;//多信号的映射
int caps_lock;
int punctuation;
bool pun_flag ;
QPoint offset;
protected:
void paintEvent(QPaintEvent *);
};
#endif // MYINPUTPANEL_H