MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / layoutElementAt

Method layoutElementAt

qcustomplot/qcustomplot.cpp:14271–14289  ·  view source on GitHub ↗

! Returns the layout element at pixel position \a pos. If there is no element at that position, returns 0. Only visible elements are used. If \ref QCPLayoutElement::setVisible on the element itself or on any of its parent elements is set to false, it will not be considered. \see itemAt, plottableAt */

Source from the content-addressed store, hash-verified

14269 \see itemAt, plottableAt
14270*/
14271QCPLayoutElement *QCustomPlot::layoutElementAt(const QPointF &pos) const
14272{
14273 QCPLayoutElement *currentElement = mPlotLayout;
14274 bool searchSubElements = true;
14275 while (searchSubElements && currentElement)
14276 {
14277 searchSubElements = false;
14278 foreach (QCPLayoutElement *subElement, currentElement->elements(false))
14279 {
14280 if (subElement && subElement->realVisibility() && subElement->selectTest(pos, false) >= 0)
14281 {
14282 currentElement = subElement;
14283 searchSubElements = true;
14284 break;
14285 }
14286 }
14287 }
14288 return currentElement;
14289}
14290
14291/*!
14292 Returns the layout element of type \ref QCPAxisRect at pixel position \a pos. This method ignores

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