| 1459 | } |
| 1460 | |
| 1461 | QSize MacroTreeDelegate::sizeHint(const QStyleOptionViewItem &option, |
| 1462 | const QModelIndex &index) const |
| 1463 | { |
| 1464 | auto tree = qobject_cast<MacroTree *>(parent()); |
| 1465 | auto widget = tree->indexWidget(index); |
| 1466 | |
| 1467 | if (!widget) { |
| 1468 | return QStyledItemDelegate::sizeHint(option, index); |
| 1469 | } |
| 1470 | |
| 1471 | auto name = index.data(Qt::AccessibleTextRole).toString(); |
| 1472 | auto macro = GetMacroByQString(name); |
| 1473 | |
| 1474 | if (!macro) { |
| 1475 | return QStyledItemDelegate::sizeHint(option, index); |
| 1476 | } |
| 1477 | |
| 1478 | if (MacroMatchesSearchFilter(macro)) { |
| 1479 | return QSize(widget->sizeHint()); |
| 1480 | } |
| 1481 | |
| 1482 | return QSize(0, 0); |
| 1483 | } |
| 1484 | |
| 1485 | } // namespace advss |
nothing calls this directly
no test coverage detected