! 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
| 26649 | \see setDataRange |
| 26650 | */ |
| 26651 | void 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 */ |
| 26665 | double QCPColorMap::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const |