Skip to content

Commit

Permalink
auto complete save image name
Browse files Browse the repository at this point in the history
  • Loading branch information
ZHEQIUSHUI committed Oct 16, 2023
1 parent 9af641c commit c280c8f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qtproj/SAMQT/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ void MainWindow::on_btn_save_img_clicked()
}
else
{
if(!(filename.endsWith(".bmp") || filename.endsWith(".png") || filename.endsWith(".jpg")))
{
filename += ".png";
}

if (!(cur_image.save(filename))) // 保存图像
{
QMessageBox::information(this,
Expand Down

0 comments on commit c280c8f

Please sign in to comment.