| 211 | } |
| 212 | |
| 213 | std::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 | |
| 239 | FileDialog::SaveResult FileDialog::getSaveFileNameWithOptions( |
| 240 | QWidget* parent, const QString& caption, const QString& dir, const QString& filter, const QString& default_suffix, |
no test coverage detected