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

Method axisRectAt

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

14272 \see layoutElementAt
14273*/
14274QCPAxisRect *QCustomPlot::axisRectAt(const QPointF &pos) const
14275{
14276 QCPAxisRect *result = 0;
14277 QCPLayoutElement *currentElement = mPlotLayout;
14278 bool searchSubElements = true;
14279 while (searchSubElements && currentElement)
14280 {
14281 searchSubElements = false;
14282 Q_FOREACH (QCPLayoutElement *subElement, currentElement->elements(false))
14283 {
14284 if (subElement && subElement->realVisibility() && subElement->selectTest(pos, false) >= 0)
14285 {
14286 currentElement = subElement;
14287 searchSubElements = true;
14288 if (QCPAxisRect *ar = qobject_cast<QCPAxisRect*>(currentElement))
14289 result = ar;
14290 break;
14291 }
14292 }
14293 }
14294 return result;
14295}
14296
14297/*!
14298 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
Q_FOREACHFunction · 0.70
selectTestMethod · 0.45

Tested by

no test coverage detected