26 #ifndef QCP_LAYOUTELEMENT_COLORSCALE_H
27 #define QCP_LAYOUTELEMENT_COLORSCALE_H
29 #include "../global.h"
31 #include "../layout.h"
32 #include "../colorgradient.h"
33 #include "../layoutelements/layoutelement-axisrect.h"
41 class QCPColorScaleAxisRectPrivate :
public QCPAxisRect
45 explicit QCPColorScaleAxisRectPrivate(
QCPColorScale *parentColorScale);
48 QImage mGradientImage;
49 bool mGradientImageInvalidated;
58 void updateGradientImage();
59 Q_SLOT
void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
60 Q_SLOT
void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
70 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
71 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
72 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
73 Q_PROPERTY(QString label READ label WRITE setLabel)
74 Q_PROPERTY(
int barWidth READ barWidth WRITE setBarWidth)
75 Q_PROPERTY(
bool rangeDrag READ rangeDrag WRITE setRangeDrag)
76 Q_PROPERTY(
bool rangeZoom READ rangeZoom WRITE setRangeZoom)
85 QCPRange dataRange()
const {
return mDataRange; }
88 QString label()
const;
89 int barWidth ()
const {
return mBarWidth; }
90 bool rangeDrag()
const;
91 bool rangeZoom()
const;
95 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
98 void setLabel(
const QString &str);
99 void setBarWidth(
int width);
100 void setRangeDrag(
bool enabled);
101 void setRangeZoom(
bool enabled);
104 QList<QCPColorMap*> colorMaps()
const;
105 void rescaleDataRange(
bool onlyVisibleMaps);
108 virtual void update(UpdatePhase phase);
111 void dataRangeChanged(
QCPRange newRange);
124 QPointer<QCPColorScaleAxisRectPrivate> mAxisRect;
125 QPointer<QCPAxis> mColorAxis;
138 friend class QCPColorScaleAxisRectPrivate;
142 #endif // QCP_LAYOUTELEMENT_COLORSCALE_H
virtual void mouseMoveEvent(QMouseEvent *event)
Definition: layout.h:136
QCPAxis * axis() const
Definition: layoutelement-colorscale.h:83
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
Definition: layout.h:142
Represents the range an axis is encompassing.
Definition: range.h:31
virtual void wheelEvent(QWheelEvent *event)
Definition: layout.h:139
virtual void mouseMoveEvent(QMouseEvent *event)
Definition: layoutelement-axisrect.cpp:947
virtual void mousePressEvent(QMouseEvent *event)
Definition: layout.h:135
Defines a color gradient for use with e.g. QCPColorMap.
Definition: colorgradient.h:32
virtual void mouseReleaseEvent(QMouseEvent *event)
Definition: layoutelement-axisrect.cpp:992
virtual void update(UpdatePhase phase)
Definition: layoutelement-axisrect.cpp:567
virtual void mousePressEvent(QMouseEvent *event)
Definition: layoutelement-axisrect.cpp:917
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: core.h:42
QPainter subclass used internally.
Definition: painter.h:111
The abstract base class for all objects that form the layout system.
Definition: layout.h:65
virtual void draw(QCPPainter *painter)
Definition: layoutelement-axisrect.cpp:612
Holds multiple axes and arranges them in a rectangular shape.
Definition: layoutelement-axisrect.h:40
A color scale for use with color coding data such as QCPColorMap.
Definition: layoutelement-colorscale.h:65
Manages a single axis inside a QCustomPlot.
Definition: axis.h:94
AxisType
Definition: axis.h:156
virtual int calculateAutoMargin(QCP::MarginSide side)
Definition: layoutelement-axisrect.cpp:891
ScaleType
Definition: axis.h:186
virtual void wheelEvent(QWheelEvent *event)
Definition: layoutelement-axisrect.cpp:1017
virtual void mouseReleaseEvent(QMouseEvent *event)
Definition: layout.h:137
A plottable representing a two-dimensional color map in a plot.
Definition: plottable-colormap.h:88
virtual void update(UpdatePhase phase)
Definition: layout.cpp:463