hc
2025-02-14 bbb9540dc49f70f6b703d1c8d1b85fa5f602d86e
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
#ifndef QKEYBOARD_H
#define QKEYBOARD_H
 
//#include "basewidget.h"
 
#include <QLabel>
#include <QLineEdit>
#include <QMouseEvent>
 
namespace Ui
{
class QKeyBoard;
}
 
class QKeyBoard : public QWidget
{
    Q_OBJECT
public:
    explicit QKeyBoard(QWidget *parent = nullptr);
    ~QKeyBoard();
 
    static QKeyBoard* getInstance()
    {
        if (!_instance) {
            _instance = new QKeyBoard;
        }
        return _instance;
    }
 
private:
    Ui::QKeyBoard *ui;
    static QKeyBoard* _instance;
    bool isShiftOn;
    QLineEdit *lineEdit;
    QPoint mousePoint;
    bool mousePressed;
 
    void changeInputType(bool caps);
    void showPanel();
    void hidePanel();
    void insertValue(const QString &value);
 
protected:
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
 
private slots:
    void slot_onApplicationFocusChanged(QWidget *, QWidget *);
    void btn_clicked();
};
 
#endif // QKEYBOARD_H