Small modal prompt on the shared Dialog chrome: a single field + OK/Cancel. The field is parented into the dialog; values must be read before `dialog` leaves scope, which is why each picker below returns the value, not a bool.
| 106 | // The field is parented into the dialog; values must be read before `dialog` |
| 107 | // leaves scope, which is why each picker below returns the value, not a bool. |
| 108 | bool execFieldDialog(Dialog& dialog, const QString& title, QWidget* field) { |
| 109 | dialog.setDialogTitle(title); |
| 110 | auto* layout = new QVBoxLayout(dialog.contentWidget()); |
| 111 | layout->addWidget(field); |
| 112 | auto* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, dialog.contentWidget()); |
| 113 | layout->addWidget(buttons); |
| 114 | QObject::connect(buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); |
| 115 | QObject::connect(buttons, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); |
| 116 | return dialog.exec() == QDialog::Accepted; |
| 117 | } |
| 118 | |
| 119 | // Topic mode: pick one of the dataset's robot_description topics. |
| 120 | std::optional<std::pair<ObjectTopicId, QString>> pickRobotDescriptionTopic( |
no test coverage detected