MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / styleValueCell

Function styleValueCell

pj_widgets/src/CurveTreeView.cpp:64–70  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

62// monospace family — a raw FixedFont renders noticeably larger than the Name
63// column.
64void 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
72QString sortKeyForItem(const QTreeWidgetItem& item) {
73 const QString cached_key = item.data(kNameColumn, kSortKeyRole).toString();

Callers 2

addCurveMethod · 0.85
addCatalogItemMethod · 0.85

Calls 1

setFontMethod · 0.45

Tested by

no test coverage detected