Fix cancel operation for example "Application"

On the save dialog the cancel option is detected now from exec()
method.

Change-Id: I977626b83fe770ddc148b57551becd04e5fd9dd5
Task-number: QTBUG-41020
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
This commit is contained in:
Mika Salmela 2014-09-16 16:54:20 +03:00
parent b462314520
commit 1fb43025f2

View File

@ -121,10 +121,10 @@ bool MainWindow::saveAs()
QFileDialog dialog(this);
dialog.setWindowModality(Qt::WindowModal);
dialog.setAcceptMode(QFileDialog::AcceptSave);
dialog.exec();
QStringList files = dialog.selectedFiles();
if (files.isEmpty())
QStringList files;
if (dialog.exec())
files = dialog.selectedFiles();
else
return false;
return saveFile(files.at(0));