closeEvent窗口:忽略状态还是确定执行

来源:互联网 发布:java序列化和反序列化 编辑:程序博客网 时间:2024/06/12 19:09
void CPMainWindow::closeEvent(QCloseEvent * e){CPTaskController *ptr = CPTaskController::get();bool doingTask = ptr->witherDoneTask();if (doingTask){bool  ret = CPMessageBox::question(this, tr("Is there a task to do, to turn off the software?"));e->isAccepted();if (ret)   //如果按下确定键e->accept();   //那我就确定退出elsee->ignore(); // 如果按下选择见那么就忽略,继续执行}}
原创粉丝点击