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

Method applyVisibleValuesToSubtree

pj_widgets/src/CurveTreeView.cpp:666–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

664}
665
666void CurveTreeView::applyVisibleValuesToSubtree(QTreeWidgetItem* item, int viewport_height) {
667 if (item->childCount() != 0) {
668 for (int i = 0; i < item->childCount(); ++i) {
669 applyVisibleValuesToSubtree(item->child(i), viewport_height);
670 }
671 return;
672 }
673 const QString key = catalogKeyForItem(item);
674 if (key.isEmpty()) {
675 return; // group placeholder / unkeyed row
676 }
677 const QRect rect = visualItemRect(item);
678 if (rect.isNull() || rect.bottom() < 0 || rect.top() > viewport_height) {
679 return; // off-screen or collapsed — skip the value lookup entirely
680 }
681 const QString text = value_provider_(key);
682 if (text == item->text(kValueColumn)) {
683 return; // value unchanged — skip setText so a stable cell emits no
684 // dataChanged / repaint (the bulk of the value column's CPU at 10 Hz)
685 }
686 item->setText(kValueColumn, text);
687 // Full value as a tooltip so a string left-elided in the narrow Value column
688 // (or a long number) stays readable on hover; trimmed of the alignment padding.
689 item->setToolTip(kValueColumn, text.trimmed());
690}
691
692void CurveTreeView::scheduleValueRefresh() {
693 // This coalesces VISIBILITY-driven re-applies (expand/collapse/scroll/resize)

Callers

nothing calls this directly

Calls 5

catalogKeyForItemFunction · 0.85
isEmptyMethod · 0.45
isNullMethod · 0.45
textMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected