! Returns all axis rects in the plot. The order of the axis rects is given by the fill order of the \ref QCPLayout that is holding them. For example, if the axis rects are in the top level grid layout (accessible via \ref QCustomPlot::plotLayout), they are ordered from left to right, top to bottom, if the layout's default \ref QCPLayoutGrid::setFillOrder "setFillOrder" of \ref QCPLayo
| 14930 | \see axisRectCount, axisRect, QCPLayoutGrid::setFillOrder |
| 14931 | */ |
| 14932 | QList<QCPAxisRect*> QCustomPlot::axisRects() const |
| 14933 | { |
| 14934 | QList<QCPAxisRect*> result; |
| 14935 | QStack<QCPLayoutElement*> elementStack; |
| 14936 | if (mPlotLayout) |
| 14937 | elementStack.push(mPlotLayout); |
| 14938 | |
| 14939 | while (!elementStack.isEmpty()) |
| 14940 | { |
| 14941 | foreach (QCPLayoutElement *element, elementStack.pop()->elements(false)) |
| 14942 | { |
| 14943 | if (element) |
| 14944 | { |
| 14945 | elementStack.push(element); |
| 14946 | if (QCPAxisRect *ar = qobject_cast<QCPAxisRect*>(element)) |
| 14947 | result.append(ar); |
| 14948 | } |
| 14949 | } |
| 14950 | } |
| 14951 | |
| 14952 | return result; |
| 14953 | } |
| 14954 | |
| 14955 | /*! |
| 14956 | Returns the layout element at pixel position \a pos. If there is no element at that position, |