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

Function applyLeafSelectability

pj_widgets/src/CurveTreeView.cpp:168–175  ·  view source on GitHub ↗

Flags for a curve leaf. A draggable leaf is a normal drag source; a value-only leaf (string field) stays selectable/highlightable but is never dragged and is tagged so the selection collectors leave it out of the drag payload.

Source from the content-addressed store, hash-verified

166// leaf (string field) stays selectable/highlightable but is never dragged and is
167// tagged so the selection collectors leave it out of the drag payload.
168void applyLeafSelectability(QTreeWidgetItem* item, bool draggable) {
169 if (draggable) {
170 item->setFlags(item->flags() | Qt::ItemIsDragEnabled | Qt::ItemIsSelectable);
171 return;
172 }
173 item->setData(kNameColumn, kValueOnlyRole, true);
174 item->setFlags((item->flags() | Qt::ItemIsSelectable) & ~Qt::ItemIsDragEnabled);
175}
176
177QString catalogKeyForItem(const QTreeWidgetItem* item) {
178 if (item == nullptr) {

Callers 1

addCatalogItemMethod · 0.85

Calls 3

setFlagsMethod · 0.80
flagsMethod · 0.80
setDataMethod · 0.45

Tested by

no test coverage detected