#include <QCloseEvent>
//头文字
void mainWindow::closeEvent( QCloseEvent * event )
{
//判断加文字,并判断点击的结果转换成0或1进行判断执行关闭还是取消
switch( QMessageBox::information( this, tr("exit tip"), tr("Do you really want exit?"), tr("Yes"), tr("No"), 0, 1 ) )
{
case 0:
event->accept();
break;
case 1:
default:
event->ignore();
break;
}
}
这里就是填写的文描述