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

Method axisRectAt

qcustomplot.cpp:14301–14322  ·  view source on GitHub ↗

! Returns the layout element of type \ref QCPAxisRect at pixel position \a pos. This method ignores other layout elements even if they are visually in front of the axis rect (e.g. a \ref QCPLegend). If there is no axis rect at that position, returns 0. Only visible axis rects are used. If \ref QCPLayoutElement::setVisible on the axis rect itself or on any of its parent elements is set t

Source from the content-addressed store, hash-verified

14299 \see layoutElementAt
14300*/
14301QCPAxisRect *QCustomPlot::axisRectAt(const QPointF &pos) const
14302{
14303 QCPAxisRect *result = 0;
14304 QCPLayoutElement *currentElement = mPlotLayout;
14305 bool searchSubElements = true;
14306 while (searchSubElements && currentElement)
14307 {
14308 searchSubElements = false;
14309 foreach (QCPLayoutElement *subElement, currentElement->elements(false))
14310 {
14311 if (subElement && subElement->realVisibility() && subElement->selectTest(pos, false) >= 0)
14312 {
14313 currentElement = subElement;
14314 searchSubElements = true;
14315 if (QCPAxisRect *ar = qobject_cast<QCPAxisRect*>(currentElement))
14316 result = ar;
14317 break;
14318 }
14319 }
14320 }
14321 return result;
14322}
14323
14324/*!
14325 Returns the axes that currently have selected parts, i.e. whose selection state is not \ref

Callers

nothing calls this directly

Calls 4

elementsMethod · 0.80
realVisibilityMethod · 0.80
foreachFunction · 0.70
selectTestMethod · 0.45

Tested by

no test coverage detected