! Returns all axis rects in the plot. \see axisRectCount, axisRect */
| 14210 | \see axisRectCount, axisRect |
| 14211 | */ |
| 14212 | QList<QCPAxisRect*> QCustomPlot::axisRects() const |
| 14213 | { |
| 14214 | QList<QCPAxisRect*> result; |
| 14215 | QStack<QCPLayoutElement*> elementStack; |
| 14216 | if (mPlotLayout) |
| 14217 | elementStack.push(mPlotLayout); |
| 14218 | |
| 14219 | while (!elementStack.isEmpty()) |
| 14220 | { |
| 14221 | Q_FOREACH (QCPLayoutElement *element, elementStack.pop()->elements(false)) |
| 14222 | { |
| 14223 | if (element) |
| 14224 | { |
| 14225 | elementStack.push(element); |
| 14226 | if (QCPAxisRect *ar = qobject_cast<QCPAxisRect*>(element)) |
| 14227 | result.append(ar); |
| 14228 | } |
| 14229 | } |
| 14230 | } |
| 14231 | |
| 14232 | return result; |
| 14233 | } |
| 14234 | |
| 14235 | /*! |
| 14236 | Returns the layout element at pixel position \a pos. If there is no element at that position, |