MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / getOpenFileName

Method getOpenFileName

pj_widgets/src/FileDialog.cpp:150–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150QString 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
170QStringList FileDialog::getOpenFileNames(
171 QWidget* parent, const QString& caption, const QString& dir, const QString& filter) {

Callers

nothing calls this directly

Calls 7

setDialogTitleMethod · 0.80
setAcceptModeMethod · 0.80
setFileModeMethod · 0.80
setDirectoryMethod · 0.80
setNameFilterMethod · 0.80
selectedFileMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected