The Value column renders monospace + right-aligned so the space-padded, fixed-precision numbers (see formatScalarForColumn) keep their decimal points in the same place from row to row. Applied to every curve leaf at creation. Keeps `base_font`'s size/weight (the tree's font) and only swaps to a monospace family — a raw FixedFont renders noticeably larger than the Name column.
| 62 | // monospace family — a raw FixedFont renders noticeably larger than the Name |
| 63 | // column. |
| 64 | void styleValueCell(QTreeWidgetItem* item, const QFont& base_font) { |
| 65 | QFont mono = base_font; |
| 66 | mono.setFamily(QFontDatabase::systemFont(QFontDatabase::FixedFont).family()); |
| 67 | mono.setStyleHint(QFont::Monospace); |
| 68 | item->setFont(kValueColumn, mono); |
| 69 | item->setTextAlignment(kValueColumn, Qt::AlignRight | Qt::AlignVCenter); |
| 70 | } |
| 71 | |
| 72 | QString sortKeyForItem(const QTreeWidgetItem& item) { |
| 73 | const QString cached_key = item.data(kNameColumn, kSortKeyRole).toString(); |
no test coverage detected