You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
938 B
C++
52 lines
938 B
C++
#ifndef CUILINEEDIT_H
|
|
#define CUILINEEDIT_H
|
|
|
|
#include <QLineEdit>
|
|
|
|
class CUIConfig;
|
|
class QLabel;
|
|
class QHBoxLayout;
|
|
class CUI;
|
|
|
|
class CUILineEdit : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit CUILineEdit(CUIConfig* config, QVector<CUI*> &subCUI, QWidget *parent = nullptr);
|
|
bool isInRange() const;
|
|
qint32 getLabelWidth();
|
|
void setLabelWidth(qint32 width);
|
|
private:
|
|
void iniUI(QVector<CUI*> &subCUI);
|
|
void appSetting();
|
|
void checkType(const QString &text);
|
|
void showMsg();
|
|
bool checkRange();
|
|
|
|
CUIConfig* conf;
|
|
QLabel* label;
|
|
QLineEdit* lineedit;
|
|
// QLayout* layout;
|
|
QHBoxLayout* layout;
|
|
|
|
QString lastEdited;
|
|
|
|
QString data_type;
|
|
QString initial_value_;
|
|
bool check_range_;
|
|
QVariant range_min_;
|
|
QVariant range_max_;
|
|
bool inclusive_;
|
|
bool required_;
|
|
|
|
|
|
signals:
|
|
|
|
|
|
private slots:
|
|
void onTextChanged(const QString &text);
|
|
|
|
};
|
|
|
|
#endif // CUILINEEDIT_H
|