| 148 | } |
| 149 | |
| 150 | QString FileDialog::getOpenFileName( |
| 151 | QWidget* parent, const QString& caption, const QString& dir, const QString& filter) { |
| 152 | FileDialog dlg(parent); |
| 153 | if (!caption.isEmpty()) { |
| 154 | dlg.setDialogTitle(caption); |
| 155 | } |
| 156 | dlg.setAcceptMode(QFileDialog::AcceptOpen); |
| 157 | dlg.setFileMode(QFileDialog::ExistingFile); |
| 158 | if (!dir.isEmpty()) { |
| 159 | dlg.setDirectory(dir); |
| 160 | } |
| 161 | if (!filter.isEmpty()) { |
| 162 | dlg.setNameFilter(filter); |
| 163 | } |
| 164 | if (dlg.exec() != QDialog::Accepted) { |
| 165 | return {}; |
| 166 | } |
| 167 | return dlg.selectedFile(); |
| 168 | } |
| 169 | |
| 170 | QStringList FileDialog::getOpenFileNames( |
| 171 | QWidget* parent, const QString& caption, const QString& dir, const QString& filter) { |
nothing calls this directly
no test coverage detected