MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / sizeHint

Method sizeHint

lib/macro/macro-tree.cpp:1461–1483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1459}
1460
1461QSize 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

Callers

nothing calls this directly

Calls 4

GetMacroByQStringFunction · 0.85
MacroMatchesSearchFilterFunction · 0.85
toStringMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected