// Prompt for proper file list open. QStringList qtractorFileListView::openFileNames (void) { // Ask for the filename to open... QStringList files = getOpenFileNames(); // Remember recent directory... if (!files.isEmpty()) setRecentDir(QFileInfo(files.first()).absolutePath()); return files; }
bool QNapiOpenDialog::selectFiles() { #if defined(Q_OS_WIN) || defined(Q_OS_MAC) files = getOpenFileNames(this, windowTitle(), directory().path(), nameFilters().join("\n")); return !files.isEmpty(); #else if (!placeWindow()) return false; setFileMode(QFileDialog::ExistingFiles); return exec(); #endif }
/* static */ QString QIFileDialog::getOpenFileName (const QString &aStartWith, const QString &aFilters, QWidget *aParent, const QString &aCaption, QString *aSelectedFilter /* = 0 */, bool aResolveSymlinks /* = true */) { return getOpenFileNames (aStartWith, aFilters, aParent, aCaption, aSelectedFilter, aResolveSymlinks, true /* aSingleFile */).value (0, ""); }
QStringList DialogGui::getOpenImageFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options ) { #ifdef IMAGE_PREVIEW QFileDialog fileDialog(parent, caption, dir, filter); initializeImageFileDialog(fileDialog, options, QFileDialog::ExistingFiles); if (fileDialog.exec() != QDialog::Accepted) return QStringList(); const QStringList selectedFiles = fileDialog.selectedFiles(); if (!selectedFiles.empty() && selectedFilter) *selectedFilter = fileDialog.selectedFilter(); return selectedFiles; #else return getOpenFileNames(parent, caption, dir, filter, selectedFilter, options); #endif }
QString EncodingFileDialog::getOpenFileName(QWidget *parent , const QString &caption, const QString &dir, const QString &filter, QString *enc) { const auto files = getOpenFileNames(parent, caption, dir, filter, enc, ExistingFile); return files.isEmpty() ? QString() : files[0]; }