feat:初始化wuhan_QT界面代码
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#ifndef PARAMCONTROL_H
|
||||
#define PARAMCONTROL_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
|
||||
// ===================== 参数调节控件 =====================
|
||||
// 参数名 + 大数值显示 + 减/加按钮 + 保存按钮(可选)+ 恢复出厂值按钮(可选)
|
||||
class ParamControl : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ParamControl(const QString& name, const QString& unit,
|
||||
double step, double min, double max,
|
||||
bool withSave, bool withFactory, QWidget* parent = nullptr);
|
||||
|
||||
void setValue(double v);
|
||||
double value() const { return m_value; }
|
||||
void setEnabled(bool enabled);
|
||||
|
||||
signals:
|
||||
void valueChanged(double v);
|
||||
void saveClicked();
|
||||
void factoryResetClicked();
|
||||
|
||||
private slots:
|
||||
void onMinus();
|
||||
void onPlus();
|
||||
|
||||
private:
|
||||
void refresh();
|
||||
|
||||
QString m_name;
|
||||
QString m_unit;
|
||||
double m_step;
|
||||
double m_min;
|
||||
double m_max;
|
||||
double m_value;
|
||||
QLabel* m_valueLabel = nullptr;
|
||||
QPushButton* m_save = nullptr;
|
||||
QPushButton* m_factory = nullptr;
|
||||
};
|
||||
|
||||
#endif // PARAMCONTROL_H
|
||||
Reference in New Issue
Block a user