| 65 | } |
| 66 | |
| 67 | QUrl FileDialogHelpers::getSaveFileUrl(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options, const QStringList &supportedSchemes) |
| 68 | { |
| 69 | QFileDialog dialog(parent, caption, dir, filter); |
| 70 | |
| 71 | dialog.setSupportedSchemes(supportedSchemes); |
| 72 | dialog.setAcceptMode(QFileDialog::AcceptSave); |
| 73 | dialog.setFilter(default_filters); |
| 74 | dialog.setOptions(options); |
| 75 | |
| 76 | if (selectedFilter && !selectedFilter->isEmpty()) |
| 77 | dialog.selectNameFilter(*selectedFilter); |
| 78 | if (dialog.exec() == QDialog::Accepted) { |
| 79 | if (selectedFilter) |
| 80 | *selectedFilter = dialog.selectedNameFilter(); |
| 81 | return dialog.selectedUrls().value(0); |
| 82 | } |
| 83 | return QUrl(); |
| 84 | } |
| 85 | |
| 86 | QString FileDialogHelpers::getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options) |
| 87 | { |