servicepassinputdlg.h 1.02 KB
#ifndef SERVICEPASSINPUTDLG_H
#define SERVICEPASSINPUTDLG_H

#include <QDialog>
#include <QKeyEvent>


#define NORMAL_PASS_WORD "00000000"
#define DEMO_PASS_WORD "11111111"
#define MAX_PASSWORD    8

namespace Ui {
class ServicePassInputDlg;
}

enum service_pass_type{
    NORMAL_SERVICE_PASS_MODE = 0,
    DEMO_SERVICE_PASS_MODE=1
};

class ServicePassInputDlg : public QDialog
{
    Q_OBJECT



    QChar m_strInputPass[MAX_PASSWORD+1];

public:
    explicit ServicePassInputDlg(QWidget *parent = 0, service_pass_type mode = NORMAL_SERVICE_PASS_MODE );
    ~ServicePassInputDlg();

private slots:
    void on_ctrBtnOk_clicked();

    void on_ctrBtnCancel_clicked();

    void keyCancel_clicked();
    void keyEnter_clicked();
    void backspaceKeyPressEvent();

    void keyboardInputEvent(QString strIn);

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

private:
    Ui::ServicePassInputDlg *ui;
    int m_nCurInputCount;
    service_pass_type m_nMode;
};

#endif // SERVICEPASSINPUTDLG_H