MCPcopy Create free account
hub / github.com/ZhuYanzhen1/miniFOC / axisRectAt

Method axisRectAt

tools/qcustomplot.cpp:14991–15012  ·  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 \c nullptr. Only visible axis rects are used. If \ref QCPLayoutElement::setVisible on the axis rect itself or on any of its parent elements

Source from the content-addressed store, hash-verified

14989 \see layoutElementAt
14990*/
14991QCPAxisRect *QCustomPlot::axisRectAt(const QPointF &pos) const
14992{
14993 QCPAxisRect *result = nullptr;
14994 QCPLayoutElement *currentElement = mPlotLayout;
14995 bool searchSubElements = true;
14996 while (searchSubElements && currentElement)
14997 {
14998 searchSubElements = false;
14999 foreach (QCPLayoutElement *subElement, currentElement->elements(false))
15000 {
15001 if (subElement && subElement->realVisibility() && subElement->selectTest(pos, false) >= 0)
15002 {
15003 currentElement = subElement;
15004 searchSubElements = true;
15005 if (QCPAxisRect *ar = qobject_cast<QCPAxisRect*>(currentElement))
15006 result = ar;
15007 break;
15008 }
15009 }
15010 }
15011 return result;
15012}
15013
15014/*!
15015 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