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

Method embedExtras

pj_widgets/src/FileDialog.cpp:213–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213std::vector<QCheckBox*> FileDialog::embedExtras(const std::vector<ExtraOption>& extras) {
214 std::vector<QCheckBox*> boxes;
215 if (extras.empty()) {
216 return boxes;
217 }
218 boxes.reserve(extras.size());
219
220 // The dialog uses QGridLayout; we append at the next row, spanning all
221 // columns so the checkbox row sits cleanly above the OK/Cancel buttons.
222 auto* extras_widget = new QWidget(inner_);
223 auto* row = new QHBoxLayout(extras_widget);
224 row->setContentsMargins(0, 0, 0, 0);
225 for (const ExtraOption& opt : extras) {
226 auto* box = new QCheckBox(opt.label, extras_widget);
227 box->setChecked(opt.default_checked);
228 row->addWidget(box);
229 boxes.push_back(box);
230 }
231 row->addStretch(1);
232 if (auto* grid = qobject_cast<QGridLayout*>(inner_->layout())) {
233 const int next_row = grid->rowCount();
234 grid->addWidget(extras_widget, next_row, 0, 1, grid->columnCount());
235 }
236 return boxes;
237}
238
239FileDialog::SaveResult FileDialog::getSaveFileNameWithOptions(
240 QWidget* parent, const QString& caption, const QString& dir, const QString& filter, const QString& default_suffix,

Callers 2

Calls 5

reserveMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
setCheckedMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected