Sh3/texit.cpp

38 lines
624 B
C++
Raw Permalink Normal View History

2025-07-02 07:45:34 +03:00
#include "texit.h"
#include "ui_texit.h"
#include "widget.h"
#include <QTimer>
Texit::Texit(QWidget *parent) :
QDialog(parent),
ui(new Ui::Texit)
{
ui->setupUi(this);
((Widget*)parent)->changeOpenWidget(this);
setAttribute(Qt::WA_DeleteOnClose);
}
Texit::~Texit()
{
delete ui;
}
void Texit::on_pushButton_2_clicked()
{
close();
}
void Texit::on_pushButton_clicked()
{
((Widget*)parent())->writeFile();
QTimer::singleShot(500, (Widget*)parent(), SLOT(MyClose()));
close();
}
void Texit::closeEvent(QCloseEvent *e)
{
((Widget*)parent())->clearOpenWidget();
e->accept();
}