From eab417536477307216b7ce3a02039c610271e283 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 8 Jun 2017 15:43:26 +0200 Subject: [PATCH] Add an automatically generated name to the 'Save as...' dialog. --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index a9af502100e..405884262d5 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1534,10 +1534,14 @@ void MainWindow::on_actionSaveAs_triggered() return; } QString caption = tr("Save %1 to File...%2").arg(item->name()).arg(ext); + //remove `)` + ext.chop(1); + //remove `(*.` + ext = ext.right(ext.size()-3); QString filename = QFileDialog::getSaveFileName(this, caption, - QString(), + QString("%1.%2").arg(item->name()).arg(ext), filters.join(";;")); if(filename.isEmpty()) return;