| 329 | } |
| 330 | |
| 331 | int MessageBox::question( |
| 332 | QWidget* parent, const QString& title, const QString& text, std::initializer_list<ButtonSpec> buttons, |
| 333 | bool* dont_show_again) { |
| 334 | MessageBox dlg(parent); |
| 335 | dlg.setTitle(title); |
| 336 | dlg.setText(text); |
| 337 | if (dont_show_again != nullptr) { |
| 338 | dlg.setShowDontShowAgain(true); |
| 339 | } |
| 340 | for (const auto& spec : buttons) { |
| 341 | dlg.addButton(spec.label, spec.role); |
| 342 | } |
| 343 | dlg.exec(); |
| 344 | if (dont_show_again != nullptr) { |
| 345 | *dont_show_again = dlg.dontShowAgainChecked(); |
| 346 | } |
| 347 | return dlg.clickedIndex(); |
| 348 | } |
| 349 | |
| 350 | } // namespace PJ |
nothing calls this directly
no test coverage detected