! 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
| 14992 | \see layoutElementAt |
| 14993 | */ |
| 14994 | QCPAxisRect *QCustomPlot::axisRectAt(const QPointF &pos) const |
| 14995 | { |
| 14996 | QCPAxisRect *result = nullptr; |
| 14997 | QCPLayoutElement *currentElement = mPlotLayout; |
| 14998 | bool searchSubElements = true; |
| 14999 | while (searchSubElements && currentElement) |
| 15000 | { |
| 15001 | searchSubElements = false; |
| 15002 | foreach (QCPLayoutElement *subElement, currentElement->elements(false)) |
| 15003 | { |
| 15004 | if (subElement && subElement->realVisibility() && subElement->selectTest(pos, false) >= 0) |
| 15005 | { |
| 15006 | currentElement = subElement; |
| 15007 | searchSubElements = true; |
| 15008 | if (QCPAxisRect *ar = qobject_cast<QCPAxisRect*>(currentElement)) |
| 15009 | result = ar; |
| 15010 | break; |
| 15011 | } |
| 15012 | } |
| 15013 | } |
| 15014 | return result; |
| 15015 | } |
| 15016 | |
| 15017 | /*! |
| 15018 | Returns the axes that currently have selected parts, i.e. whose selection state is not \ref |
nothing calls this directly
no test coverage detected