用于设置取消时,询问是否保存修改的DLG
void SetWindow::cancelButton()
{
if( m_IsChange)
{
QMessageBox msgBox;
msgBox.setText(tr("The crap has been changed."));
msgBox.setInformativeText(tr("Do you want to save your changes?"));
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Save);
int ret = msgBox.exec();
switch (ret)
{
case QMessageBox::Discard:
m_IsChange = false;
case QMessageBox::Save:
okButton();
break;
case QMessageBox::Cancel:
default:
break;
}
}
else
{
okButton();
}
}