keyboardwidget.h 1.07 KB
 #ifndef KEYBOARDWIDGET_H
#define KEYBOARDWIDGET_H

#include <QWidget>
#include <QSignalMapper>
#include <QChar>
#include <QVector>
#include <QPushButton>


namespace Ui {
class KeyboardWidget;
}

class KeyboardWidget : public QWidget
{
    Q_OBJECT

public:
    explicit KeyboardWidget(QWidget *parent = 0);
    ~KeyboardWidget();

private slots:
    void on_pushButton_41_clicked();

    void on_pushButton_42_clicked();

    void on_pushButton_39_clicked();

    void on_pushButton_40_clicked();

signals:
    void onKeyboardClickSignal(const QString in);
    void onBackspaceKeyClicked();
    void onOkKeyClicked();
    void onCancelKeyClicked();
    void onSpaceKeyClicked();

public slots:
    void onKeyboardClicked(int in);
    void focusInKeyboard();
    void focusOutKeyboard();

protected:
    void keyPressEvent(QKeyEvent* event);
    void keyReleaseEvent(QKeyEvent* event);


private:
    Ui::KeyboardWidget *ui;

    QSignalMapper *m_pSignalMapper;

    QVector<QPushButton*> m_vectorTabOrder;
    QPushButton* m_pCurCheckedBtn;
    int m_nCurTabPos;
};

#endif // KEYBOARDWIDGET_H