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

Method layoutElementAt

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

14242 \see itemAt, plottableAt
14243*/
14244QCPLayoutElement *QCustomPlot::layoutElementAt(const QPointF &pos) const
14245{
14246 QCPLayoutElement *currentElement = mPlotLayout;
14247 bool searchSubElements = true;
14248 while (searchSubElements && currentElement)
14249 {
14250 searchSubElements = false;
14251 Q_FOREACH (QCPLayoutElement *subElement, currentElement->elements(false))
14252 {
14253 if (subElement && subElement->realVisibility() && subElement->selectTest(pos, false) >= 0)
14254 {
14255 currentElement = subElement;
14256 searchSubElements = true;
14257 break;
14258 }
14259 }
14260 }
14261 return currentElement;
14262}
14263
14264/*!
14265 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
Q_FOREACHFunction · 0.70
selectTestMethod · 0.45

Tested by

no test coverage detected