38 lines
624 B
C++
38 lines
624 B
C++
|
#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();
|
||
|
}
|