| 167 | } |
| 168 | |
| 169 | QLineEdit* OptionsWidget::AddOptionFilePath(std::filesystem::path* option, |
| 170 | const std::string& label_text) { |
| 171 | QLineEdit* line_edit = new QLineEdit(this); |
| 172 | line_edit->setText(QString::fromStdString(option->string())); |
| 173 | |
| 174 | AddOptionRow(label_text, line_edit, option); |
| 175 | |
| 176 | auto SelectPathFunc = [this, line_edit]() { |
| 177 | line_edit->setText(QFileDialog::getOpenFileName(this, tr("Select file"))); |
| 178 | }; |
| 179 | |
| 180 | QPushButton* select_button = new QPushButton(tr("Select file"), this); |
| 181 | select_button->setFont(font()); |
| 182 | connect(select_button, &QPushButton::released, this, SelectPathFunc); |
| 183 | grid_layout_->addWidget(select_button, grid_layout_->rowCount(), 1); |
| 184 | |
| 185 | options_path_.emplace_back(line_edit, option); |
| 186 | |
| 187 | return line_edit; |
| 188 | } |
| 189 | |
| 190 | QLineEdit* OptionsWidget::AddOptionDirPath(std::filesystem::path* option, |
| 191 | const std::string& label_text) { |
no outgoing calls
no test coverage detected