twain3/ui/indicator.cpp

36 lines
715 B
C++

#include "indicator.h"
#include "ui_indicator.h"
Indicator::Indicator(std::function<void()> canle, QWidget* parent) :
QDialog(parent),
btncanle(canle),
ui(new Ui::Indicator)
{
ui->setupUi(this);
QObject::connect(ui->btncanle, &QPushButton::pressed, this, &Indicator::on_btncanle_click);
this->setWindowTitle("Indicator");
//this->setWindowFlags(Qt::WindowCloseButtonHint);
}
Indicator::~Indicator()
{
delete ui;
}
void Indicator::on_btncanle_click()
{
if (btncanle)
btncanle();
}
void Indicator::settext(std::string str)
{
ui->lb_indicatortext->setText(str.c_str());
}
void Indicator::closeEvent(QCloseEvent* event)
{
// if (btncanle)
// btncanle();
}