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

Method getSaveFileName

pj_widgets/src/FileDialog.cpp:190–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190QString FileDialog::getSaveFileName(
191 QWidget* parent, const QString& caption, const QString& dir, const QString& filter, const QString& default_suffix) {
192 FileDialog dlg(parent);
193 if (!caption.isEmpty()) {
194 dlg.setDialogTitle(caption);
195 }
196 dlg.setAcceptMode(QFileDialog::AcceptSave);
197 dlg.setFileMode(QFileDialog::AnyFile);
198 if (!dir.isEmpty()) {
199 dlg.setDirectory(dir);
200 }
201 if (!filter.isEmpty()) {
202 dlg.setNameFilter(filter);
203 }
204 if (!default_suffix.isEmpty()) {
205 dlg.setDefaultSuffix(default_suffix);
206 }
207 if (dlg.exec() != QDialog::Accepted) {
208 return {};
209 }
210 return dlg.selectedFile();
211}
212
213std::vector<QCheckBox*> FileDialog::embedExtras(const std::vector<ExtraOption>& extras) {
214 std::vector<QCheckBox*> boxes;

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected