MCPcopy Create free account
hub / github.com/collin80/SavvyCAN / selectedLegends

Method selectedLegends

qcustomplot.cpp:14353–14378  ·  view source on GitHub ↗

! Returns the legends that currently have selected parts, i.e. whose selection state is not \ref QCPLegend::spNone. \see selectedPlottables, selectedAxes, setInteractions, QCPLegend::setSelectedParts, QCPLegend::setSelectableParts, QCPLegend::selectedItems */

Source from the content-addressed store, hash-verified

14351 QCPLegend::setSelectableParts, QCPLegend::selectedItems
14352*/
14353QList<QCPLegend*> QCustomPlot::selectedLegends() const
14354{
14355 QList<QCPLegend*> result;
14356
14357 QStack<QCPLayoutElement*> elementStack;
14358 if (mPlotLayout)
14359 elementStack.push(mPlotLayout);
14360
14361 while (!elementStack.isEmpty())
14362 {
14363 foreach (QCPLayoutElement *subElement, elementStack.pop()->elements(false))
14364 {
14365 if (subElement)
14366 {
14367 elementStack.push(subElement);
14368 if (QCPLegend *leg = qobject_cast<QCPLegend*>(subElement))
14369 {
14370 if (leg->selectedParts() != QCPLegend::spNone)
14371 result.append(leg);
14372 }
14373 }
14374 }
14375 }
14376
14377 return result;
14378}
14379
14380/*!
14381 Deselects all layerables (plottables, items, axes, legends,...) of the QCustomPlot.

Callers

nothing calls this directly

Calls 5

elementsMethod · 0.80
selectedPartsMethod · 0.80
appendMethod · 0.80
foreachFunction · 0.70
isEmptyMethod · 0.45

Tested by

no test coverage detected