| 193 | } |
| 194 | |
| 195 | QWidget *PreferencesHelper::addPreferenceFileBrowser(Preferences *p, QString id, QString title, QString description, |
| 196 | FileBrowserWidget::BrowserDialogType type, QObject *parent) |
| 197 | { |
| 198 | QWidget *widget = new QWidget(); |
| 199 | QHBoxLayout *layout = new QHBoxLayout(); |
| 200 | layout->setMargin(0); |
| 201 | layout->setSpacing(0); |
| 202 | layout->setMargin(0); |
| 203 | widget->setLayout(layout); |
| 204 | |
| 205 | QWidget *infoBtn = setupDescriptionButton(id, description, parent); |
| 206 | |
| 207 | QLabel *label = new QLabel(title, widget); |
| 208 | p->initDescription(id, title, description); |
| 209 | |
| 210 | QSpacerItem *space = new QSpacerItem(20, 20, QSizePolicy::Preferred, QSizePolicy::Preferred); |
| 211 | |
| 212 | FileBrowserWidget *fileBrowser = new FileBrowserWidget(type, widget); |
| 213 | |
| 214 | QString pref1Val = p->get(id).toString(); |
| 215 | QLineEdit *browserEdit = fileBrowser->lineEdit(); |
| 216 | browserEdit->setText(pref1Val); |
| 217 | parent->connect(browserEdit, &QLineEdit::textChanged, parent, [p, id](QString b) { p->set(id, b); }); |
| 218 | |
| 219 | layout->addWidget(infoBtn); |
| 220 | layout->addWidget(label, 1); |
| 221 | layout->addSpacerItem(space); |
| 222 | layout->addWidget(fileBrowser, 1); |
| 223 | |
| 224 | return widget; |
| 225 | } |
| 226 | |
| 227 | QWidget *PreferencesHelper::addPreferenceCombo(Preferences *p, QString id, QString title, QString description, |
| 228 | QStringList options, QObject *parent) |
nothing calls this directly
no test coverage detected