modify
This commit is contained in:
+33
-17
@@ -1,16 +1,18 @@
|
||||
#ifndef NUMKEYDIA_H
|
||||
#ifndef NUMKEYDIA_H
|
||||
#define NUMKEYDIA_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include "NumKeyBoard_global.h"
|
||||
#include <QDialog>
|
||||
#include <QLineEdit>
|
||||
|
||||
class QPushButton;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class NumKeyDia;
|
||||
}
|
||||
|
||||
class Q_DECL_EXPORT NumKeyDia : public QDialog
|
||||
class NUMKEYBOARD_EXPORT NumKeyDia : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -18,15 +20,16 @@ public:
|
||||
explicit NumKeyDia(QWidget *parent = nullptr);
|
||||
~NumKeyDia();
|
||||
|
||||
QLineEdit *pLineEdit() const;
|
||||
void setPLineEdit(QLineEdit *newPLineEdit);
|
||||
static NumKeyDia *instance()
|
||||
{
|
||||
return singleton;
|
||||
}
|
||||
|
||||
void setMinValue(double newMinValue);
|
||||
|
||||
void setMaxValue(double newMaxValue);
|
||||
void setValue(const QString &value);
|
||||
QString &getValue();
|
||||
|
||||
protected:
|
||||
virtual bool eventFilter(QObject * obj, QEvent *event) override;
|
||||
virtual bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
private slots:
|
||||
void on_btn_ok_clicked();
|
||||
@@ -42,22 +45,35 @@ private slots:
|
||||
void closeKeyBoard();
|
||||
|
||||
private:
|
||||
enum class InputPage
|
||||
{
|
||||
NumberPage,
|
||||
SymbolPage
|
||||
};
|
||||
|
||||
void setInputPage(InputPage page);
|
||||
void refreshInputButtons();
|
||||
void configureInputButton(QPushButton *button,
|
||||
const QString &label,
|
||||
const QString &value,
|
||||
bool enabled,
|
||||
bool isModeSwitch = false);
|
||||
|
||||
Ui::NumKeyDia *ui;
|
||||
|
||||
QLineEdit *m_pLineEdit = nullptr;
|
||||
static NumKeyDia *singleton;
|
||||
|
||||
bool m_bMaxFlag = false;
|
||||
QString value = QString();
|
||||
|
||||
QPoint m_point;
|
||||
|
||||
bool m_firstInputFlag = true;
|
||||
InputPage m_inputPage = InputPage::NumberPage;
|
||||
};
|
||||
|
||||
double m_minValue = 0.000;
|
||||
double m_maxValue = 0.000;
|
||||
bool m_isNum = false;
|
||||
bool m_isDouble = false;
|
||||
char m_format = 'f';
|
||||
int m_prec = 3;
|
||||
namespace KeyBoard
|
||||
{
|
||||
NUMKEYBOARD_EXPORT NumKeyDia *app();
|
||||
};
|
||||
|
||||
#endif // NUMKEYDIA_H
|
||||
|
||||
Reference in New Issue
Block a user