保存棋谱对话框的文件名加上时间戳

This commit is contained in:
CalciteM 2019-06-30 08:22:55 +08:00
parent 9d2f97420a
commit 60397cb4b9
1 changed files with 3 additions and 2 deletions

View File

@ -501,9 +501,10 @@ void NineChessWindow::on_actionSave_S_triggered()
void NineChessWindow::on_actionSaveAs_A_triggered()
{
QString path = QFileDialog::getSaveFileName(this,
tr("打开棋谱文件"), QDir::currentPath() + tr("棋谱.txt"), "TXT(*.txt)");
tr("打开棋谱文件"),
QDir::currentPath() + tr("棋谱_") + QString::number(QDateTime::currentDateTime().toTime_t()) + ".txt", "TXT(*.txt)");
if (path.isEmpty() == false) {
if (path.isEmpty() == false) {
if (file.isOpen())
file.close();