53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
#ifndef COUNTERVARSET_H
|
|
#define COUNTERVARSET_H
|
|
|
|
#include <QWidget>
|
|
#include <QTextEdit>
|
|
#include <QTextCharFormat>
|
|
#include "scene/ViewModels.h"
|
|
|
|
namespace Ui {
|
|
class CounterVarSet;
|
|
}
|
|
|
|
class CounterEditor;
|
|
|
|
class CounterVarSet : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit CounterVarSet(QWidget *parent = 0);
|
|
~CounterVarSet();
|
|
|
|
void init();
|
|
void applyStyleSheet();
|
|
void getValue(int *varType,int *digitalWidth,unsigned char *splitMode);
|
|
|
|
void updateSysParaToUI(); //重载
|
|
void applyUIPara(); //重载
|
|
|
|
// 获取当前计数器配置:varType(7或8) 和 digitalNum(位数)
|
|
CounterViewModel getCounterConfig();
|
|
|
|
// 设置ui,用户编辑计数器item时,会调用此函数显示计数器的配置
|
|
void setCounterConfig(CounterViewModel viewModel);
|
|
signals:
|
|
void sendButtonClickedSignal(int);
|
|
|
|
void sig_clearTextEdit();
|
|
void sig_updateSelectedCounter();
|
|
|
|
private slots:
|
|
void buttonClickedSlot();
|
|
void onDigitsChanged(int digits);
|
|
|
|
private:
|
|
Ui::CounterVarSet *ui;
|
|
|
|
CounterViewModel m_vm;
|
|
};
|
|
|
|
#endif // COUNTERVARSET_H
|