MCPcopy Create free account
hub / github.com/LUX-Core/lux / selectedLegends

Method selectedLegends

src/qt/qcustomplot.cpp:14326–14351  ·  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

14324 QCPLegend::setSelectableParts, QCPLegend::selectedItems
14325*/
14326QList<QCPLegend*> QCustomPlot::selectedLegends() const
14327{
14328 QList<QCPLegend*> result;
14329
14330 QStack<QCPLayoutElement*> elementStack;
14331 if (mPlotLayout)
14332 elementStack.push(mPlotLayout);
14333
14334 while (!elementStack.isEmpty())
14335 {
14336 Q_FOREACH (QCPLayoutElement *subElement, elementStack.pop()->elements(false))
14337 {
14338 if (subElement)
14339 {
14340 elementStack.push(subElement);
14341 if (QCPLegend *leg = qobject_cast<QCPLegend*>(subElement))
14342 {
14343 if (leg->selectedParts() != QCPLegend::spNone)
14344 result.append(leg);
14345 }
14346 }
14347 }
14348 }
14349
14350 return result;
14351}
14352
14353/*!
14354 Deselects all layerables (plottables, items, axes, legends,...) of the QCustomPlot.

Callers

nothing calls this directly

Calls 7

elementsMethod · 0.80
selectedPartsMethod · 0.80
Q_FOREACHFunction · 0.70
pushMethod · 0.45
isEmptyMethod · 0.45
popMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected