MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / updateLegendIcon

Method updateLegendIcon

3rdparty/qcustomplot/qcustomplot.cpp:26651–26662  ·  view source on GitHub ↗

! Takes the current appearance of the color map and updates the legend icon, which is used to represent this color map in the legend (see \ref QCPLegend). The \a transformMode specifies whether the rescaling is done by a faster, low quality image scaling algorithm (Qt::FastTransformation) or by a slower, higher quality algorithm (Qt::SmoothTransformation). The current color map a

Source from the content-addressed store, hash-verified

26649 \see setDataRange
26650*/
26651void QCPColorMap::updateLegendIcon(Qt::TransformationMode transformMode, const QSize &thumbSize)
26652{
26653 if (mMapImage.isNull() && !data()->isEmpty())
26654 updateMapImage(); // try to update map image if it's null (happens if no draw has happened yet)
26655
26656 if (!mMapImage.isNull()) // might still be null, e.g. if data is empty, so check here again
26657 {
26658 bool mirrorX = (keyAxis()->orientation() == Qt::Horizontal ? keyAxis() : valueAxis())->rangeReversed();
26659 bool mirrorY = (valueAxis()->orientation() == Qt::Vertical ? valueAxis() : keyAxis())->rangeReversed();
26660 mLegendIcon = QPixmap::fromImage(mMapImage.mirrored(mirrorX, mirrorY)).scaled(thumbSize, Qt::KeepAspectRatio, transformMode);
26661 }
26662}
26663
26664/* inherits documentation from base class */
26665double QCPColorMap::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const

Callers

nothing calls this directly

Calls 5

keyAxisFunction · 0.85
valueAxisFunction · 0.85
dataFunction · 0.70
isNullMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected