#include "indicator.h" #include "ui_indicator.h" Indicator::Indicator(std::function 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::closeEvent(QCloseEvent* event) { // if (btncanle) // btncanle(); }