1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| #include "parasetwid.h" #include "ui_parasetwid.h"
ParaSetWid::ParaSetWid(QWidget *parent) : QWidget(parent), ui(new Ui::ParaSetWid) { ui->setupUi(this); setWindowModality(Qt::ApplicationModal); }
ParaSetWid::~ParaSetWid() { delete ui; }
int ParaSetWid::exec() { m_Result=-1; this->show(); m_Loop=new QEventLoop(this); m_Loop->exec(); return m_Result; }
void ParaSetWid::closeEvent(QCloseEvent *event) { if(m_Loop!=NULL) { m_Loop->exit(); } event->accept(); }
void ParaSetWid::on_OKBtn_clicked() { m_Result=1; this->close(); }
void ParaSetWid::on_CanBtn_clicked() { m_Result=0; this->close(); }
|