MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / setColorScale

Method setColorScale

3rdparty/qcustomplot/qcustomplot.cpp:26584–26608  ·  view source on GitHub ↗

! Associates the color scale \a colorScale with this color map. This means that both the color scale and the color map synchronize their gradient, data range and data scale type (\ref setGradient, \ref setDataRange, \ref setDataScaleType). Multiple color maps can be associated with one single color scale. This causes the color maps to also synchronize those properties, via the mutual

Source from the content-addressed store, hash-verified

26582 Pass \c nullptr as \a colorScale to disconnect the color scale from this color map again.
26583*/
26584void QCPColorMap::setColorScale(QCPColorScale *colorScale)
26585{
26586 if (mColorScale) // unconnect signals from old color scale
26587 {
26588 disconnect(this, SIGNAL(dataRangeChanged(QCPRange)), mColorScale.data(), SLOT(setDataRange(QCPRange)));
26589 disconnect(this, SIGNAL(dataScaleTypeChanged(QCPAxis::ScaleType)), mColorScale.data(), SLOT(setDataScaleType(QCPAxis::ScaleType)));
26590 disconnect(this, SIGNAL(gradientChanged(QCPColorGradient)), mColorScale.data(), SLOT(setGradient(QCPColorGradient)));
26591 disconnect(mColorScale.data(), SIGNAL(dataRangeChanged(QCPRange)), this, SLOT(setDataRange(QCPRange)));
26592 disconnect(mColorScale.data(), SIGNAL(gradientChanged(QCPColorGradient)), this, SLOT(setGradient(QCPColorGradient)));
26593 disconnect(mColorScale.data(), SIGNAL(dataScaleTypeChanged(QCPAxis::ScaleType)), this, SLOT(setDataScaleType(QCPAxis::ScaleType)));
26594 }
26595 mColorScale = colorScale;
26596 if (mColorScale) // connect signals to new color scale
26597 {
26598 setGradient(mColorScale.data()->gradient());
26599 setDataRange(mColorScale.data()->dataRange());
26600 setDataScaleType(mColorScale.data()->dataScaleType());
26601 connect(this, SIGNAL(dataRangeChanged(QCPRange)), mColorScale.data(), SLOT(setDataRange(QCPRange)));
26602 connect(this, SIGNAL(dataScaleTypeChanged(QCPAxis::ScaleType)), mColorScale.data(), SLOT(setDataScaleType(QCPAxis::ScaleType)));
26603 connect(this, SIGNAL(gradientChanged(QCPColorGradient)), mColorScale.data(), SLOT(setGradient(QCPColorGradient)));
26604 connect(mColorScale.data(), SIGNAL(dataRangeChanged(QCPRange)), this, SLOT(setDataRange(QCPRange)));
26605 connect(mColorScale.data(), SIGNAL(gradientChanged(QCPColorGradient)), this, SLOT(setGradient(QCPColorGradient)));
26606 connect(mColorScale.data(), SIGNAL(dataScaleTypeChanged(QCPAxis::ScaleType)), this, SLOT(setDataScaleType(QCPAxis::ScaleType)));
26607 }
26608}
26609
26610/*!
26611 Sets the data range (\ref setDataRange) to span the minimum and maximum values that occur in the

Callers

nothing calls this directly

Calls 3

connectFunction · 0.85
dataMethod · 0.45
dataRangeMethod · 0.45

Tested by

no test coverage detected