| 30 | |
| 31 | |
| 32 | QList<QUrl> FileDialogHelpers::getOpenFileUrls(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options, const QStringList &supportedSchemes) |
| 33 | { |
| 34 | QFileDialog dialog(parent, caption, dir, filter); |
| 35 | |
| 36 | dialog.setSupportedSchemes(supportedSchemes); |
| 37 | dialog.setFilter(default_filters); |
| 38 | dialog.setOptions(options); |
| 39 | dialog.setFileMode(QFileDialog::ExistingFiles); |
| 40 | |
| 41 | if (selectedFilter && !selectedFilter->isEmpty()) |
| 42 | dialog.selectNameFilter(*selectedFilter); |
| 43 | if (dialog.exec() == QDialog::Accepted) { |
| 44 | if (selectedFilter) |
| 45 | *selectedFilter = dialog.selectedNameFilter(); |
| 46 | return dialog.selectedUrls(); |
| 47 | } |
| 48 | return QList<QUrl>(); |
| 49 | } |
| 50 | |
| 51 | QStringList FileDialogHelpers::getOpenFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options) |
| 52 | { |