| 316 | } |
| 317 | |
| 318 | void AddSelectionEntry(QComboBox *sel, const char *description, bool selectable, |
| 319 | const char *tooltip) |
| 320 | { |
| 321 | sel->insertItem(0, description); |
| 322 | |
| 323 | if (strcmp(tooltip, "") != 0) { |
| 324 | sel->setItemData(0, tooltip, Qt::ToolTipRole); |
| 325 | } |
| 326 | |
| 327 | QStandardItemModel *model = |
| 328 | qobject_cast<QStandardItemModel *>(sel->model()); |
| 329 | QModelIndex firstIndex = |
| 330 | model->index(0, sel->modelColumn(), sel->rootModelIndex()); |
| 331 | QStandardItem *firstItem = model->itemFromIndex(firstIndex); |
| 332 | if (!selectable) { |
| 333 | firstItem->setSelectable(false); |
| 334 | firstItem->setEnabled(false); |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | void AddSelectionGroup(QComboBox *selection, const QStringList &group, |
| 339 | bool addSeparator) |
no test coverage detected