! Creates a QCPAxisRect instance and sets default values. An axis is added for each of the four sides, the top and right axes are set invisible initially. */
| 17553 | sides, the top and right axes are set invisible initially. |
| 17554 | */ |
| 17555 | QCPAxisRect::QCPAxisRect(QCustomPlot *parentPlot, bool setupDefaultAxes) : |
| 17556 | QCPLayoutElement(parentPlot), |
| 17557 | mBackgroundBrush(Qt::NoBrush), |
| 17558 | mBackgroundScaled(true), |
| 17559 | mBackgroundScaledMode(Qt::KeepAspectRatioByExpanding), |
| 17560 | mInsetLayout(new QCPLayoutInset), |
| 17561 | mRangeDrag(Qt::Horizontal|Qt::Vertical), |
| 17562 | mRangeZoom(Qt::Horizontal|Qt::Vertical), |
| 17563 | mRangeZoomFactorHorz(0.85), |
| 17564 | mRangeZoomFactorVert(0.85), |
| 17565 | mDragging(false) |
| 17566 | { |
| 17567 | mInsetLayout->initializeParentPlot(mParentPlot); |
| 17568 | mInsetLayout->setParentLayerable(this); |
| 17569 | mInsetLayout->setParent(this); |
| 17570 | |
| 17571 | setMinimumSize(50, 50); |
| 17572 | setMinimumMargins(QMargins(15, 15, 15, 15)); |
| 17573 | mAxes.insert(QCPAxis::atLeft, QList<QCPAxis*>()); |
| 17574 | mAxes.insert(QCPAxis::atRight, QList<QCPAxis*>()); |
| 17575 | mAxes.insert(QCPAxis::atTop, QList<QCPAxis*>()); |
| 17576 | mAxes.insert(QCPAxis::atBottom, QList<QCPAxis*>()); |
| 17577 | |
| 17578 | if (setupDefaultAxes) |
| 17579 | { |
| 17580 | QCPAxis *xAxis = addAxis(QCPAxis::atBottom); |
| 17581 | QCPAxis *yAxis = addAxis(QCPAxis::atLeft); |
| 17582 | QCPAxis *xAxis2 = addAxis(QCPAxis::atTop); |
| 17583 | QCPAxis *yAxis2 = addAxis(QCPAxis::atRight); |
| 17584 | setRangeDragAxes(xAxis, yAxis); |
| 17585 | setRangeZoomAxes(xAxis, yAxis); |
| 17586 | xAxis2->setVisible(false); |
| 17587 | yAxis2->setVisible(false); |
| 17588 | xAxis->grid()->setVisible(true); |
| 17589 | yAxis->grid()->setVisible(true); |
| 17590 | xAxis2->grid()->setVisible(false); |
| 17591 | yAxis2->grid()->setVisible(false); |
| 17592 | xAxis2->grid()->setZeroLinePen(Qt::NoPen); |
| 17593 | yAxis2->grid()->setZeroLinePen(Qt::NoPen); |
| 17594 | xAxis2->grid()->setVisible(false); |
| 17595 | yAxis2->grid()->setVisible(false); |
| 17596 | } |
| 17597 | } |
| 17598 | |
| 17599 | QCPAxisRect::~QCPAxisRect() |
| 17600 | { |
nothing calls this directly
no test coverage detected