58 lines
1.0 KiB
C++
58 lines
1.0 KiB
C++
|
#include "fesparambtn.h"
|
||
|
#include "ui_fesparambtn.h"
|
||
|
#include <QMouseEvent>
|
||
|
#include <QDebug>
|
||
|
FesParamBtn::FesParamBtn(QWidget *parent) :
|
||
|
QWidget(parent),
|
||
|
ui(new Ui::FesParamBtn)
|
||
|
{
|
||
|
ui->setupUi(this);
|
||
|
}
|
||
|
|
||
|
FesParamBtn::~FesParamBtn()
|
||
|
{
|
||
|
delete ui;
|
||
|
}
|
||
|
|
||
|
void FesParamBtn::initButton(QString title,QString unit)
|
||
|
{
|
||
|
ui->title_Label->setText(title);
|
||
|
ui->unit_Label->setText(unit);
|
||
|
// qDebug()<<"初始化按钮:"<<title <<unit;
|
||
|
}
|
||
|
|
||
|
void FesParamBtn::setTitle(QString title)
|
||
|
{
|
||
|
ui->title_Label->setText(title);
|
||
|
}
|
||
|
|
||
|
void FesParamBtn::setData(int data)
|
||
|
{
|
||
|
ui->data_Label->setText(QString::number(data));
|
||
|
}
|
||
|
|
||
|
void FesParamBtn::mousePressEvent(QMouseEvent *event)
|
||
|
{
|
||
|
Q_UNUSED(event)
|
||
|
emit fesButtonClicked();
|
||
|
}
|
||
|
|
||
|
int FesParamBtn::getValue()
|
||
|
{
|
||
|
m_value = ui->data_Label->text().toInt();
|
||
|
return m_value;
|
||
|
}
|
||
|
|
||
|
void FesParamBtn::changeEvent(QEvent* event)
|
||
|
{
|
||
|
switch (event->type())
|
||
|
{
|
||
|
case QEvent::LanguageChange:
|
||
|
;//ui->retranslateUi(this);
|
||
|
break;
|
||
|
default:
|
||
|
QWidget::changeEvent(event);
|
||
|
break;
|
||
|
}
|
||
|
}
|