! Creates a new instance, as a child of \a parentColorScale. */
| 20567 | Creates a new instance, as a child of \a parentColorScale. |
| 20568 | */ |
| 20569 | QCPColorScaleAxisRectPrivate::QCPColorScaleAxisRectPrivate(QCPColorScale *parentColorScale) : |
| 20570 | QCPAxisRect(parentColorScale->parentPlot(), true), |
| 20571 | mParentColorScale(parentColorScale), |
| 20572 | mGradientImageInvalidated(true) |
| 20573 | { |
| 20574 | setParentLayerable(parentColorScale); |
| 20575 | setMinimumMargins(QMargins(0, 0, 0, 0)); |
| 20576 | const QList<QCPAxis::AxisType> allAxisTypes = QList<QCPAxis::AxisType>() << QCPAxis::atBottom << QCPAxis::atTop << QCPAxis::atLeft << QCPAxis::atRight; |
| 20577 | foreach (QCPAxis::AxisType type, allAxisTypes) |
| 20578 | { |
| 20579 | axis(type)->setVisible(true); |
| 20580 | axis(type)->grid()->setVisible(false); |
| 20581 | axis(type)->setPadding(0); |
| 20582 | connect(axis(type), SIGNAL(selectionChanged(QCPAxis::SelectableParts)), this, SLOT(axisSelectionChanged(QCPAxis::SelectableParts))); |
| 20583 | connect(axis(type), SIGNAL(selectableChanged(QCPAxis::SelectableParts)), this, SLOT(axisSelectableChanged(QCPAxis::SelectableParts))); |
| 20584 | } |
| 20585 | |
| 20586 | connect(axis(QCPAxis::atLeft), SIGNAL(rangeChanged(QCPRange)), axis(QCPAxis::atRight), SLOT(setRange(QCPRange))); |
| 20587 | connect(axis(QCPAxis::atRight), SIGNAL(rangeChanged(QCPRange)), axis(QCPAxis::atLeft), SLOT(setRange(QCPRange))); |
| 20588 | connect(axis(QCPAxis::atBottom), SIGNAL(rangeChanged(QCPRange)), axis(QCPAxis::atTop), SLOT(setRange(QCPRange))); |
| 20589 | connect(axis(QCPAxis::atTop), SIGNAL(rangeChanged(QCPRange)), axis(QCPAxis::atBottom), SLOT(setRange(QCPRange))); |
| 20590 | connect(axis(QCPAxis::atLeft), SIGNAL(scaleTypeChanged(QCPAxis::ScaleType)), axis(QCPAxis::atRight), SLOT(setScaleType(QCPAxis::ScaleType))); |
| 20591 | connect(axis(QCPAxis::atRight), SIGNAL(scaleTypeChanged(QCPAxis::ScaleType)), axis(QCPAxis::atLeft), SLOT(setScaleType(QCPAxis::ScaleType))); |
| 20592 | connect(axis(QCPAxis::atBottom), SIGNAL(scaleTypeChanged(QCPAxis::ScaleType)), axis(QCPAxis::atTop), SLOT(setScaleType(QCPAxis::ScaleType))); |
| 20593 | connect(axis(QCPAxis::atTop), SIGNAL(scaleTypeChanged(QCPAxis::ScaleType)), axis(QCPAxis::atBottom), SLOT(setScaleType(QCPAxis::ScaleType))); |
| 20594 | |
| 20595 | // make layer transfers of color scale transfer to axis rect and axes |
| 20596 | // the axes must be set after axis rect, such that they appear above color gradient drawn by axis rect: |
| 20597 | connect(parentColorScale, SIGNAL(layerChanged(QCPLayer*)), this, SLOT(setLayer(QCPLayer*))); |
| 20598 | foreach (QCPAxis::AxisType type, allAxisTypes) |
| 20599 | connect(parentColorScale, SIGNAL(layerChanged(QCPLayer*)), axis(type), SLOT(setLayer(QCPLayer*))); |
| 20600 | } |
| 20601 | |
| 20602 | /*! \internal |
| 20603 |