16 #ifndef QGSGRADIENTSTOPEDITOR_H 17 #define QGSGRADIENTSTOPEDITOR_H 64 void selectStop(
int index );
72 QSize sizeHint()
const override;
73 void paintEvent( QPaintEvent *event )
override;
85 void setSelectedStopColor(
const QColor &color );
94 void setSelectedStopOffset(
double offset );
103 void setSelectedStopDetails(
const QColor &color,
double offset );
109 void deleteSelectedStop();
117 void setColor1(
const QColor &color );
125 void setColor2(
const QColor &color );
140 void mouseMoveEvent( QMouseEvent *event )
override;
141 void mousePressEvent( QMouseEvent *event )
override;
142 void mouseDoubleClickEvent( QMouseEvent *event )
override;
143 void keyPressEvent( QKeyEvent *event )
override;
146 void dragEnterEvent( QDragEnterEvent *e )
override;
149 void dropEvent( QDropEvent *e )
override;
157 QPixmap transparentBackground();
166 void drawStopMarker( QPainter &painter, QPoint topMiddle,
const QColor &color,
bool selected =
false );
169 double pointToRelativePosition(
int x )
const;
172 int relativePositionToPoint(
double position )
const;
175 bool selectedStopIsMovable()
const;
178 int findClosestStop(
int x,
int threshold = -1 )
const;
186 int mSelectedStop = 0;
189 QPolygonF sOuterTriangle;
192 QPolygonF sInnerTriangle;
196 #endif // QGSGRADIENTSTOPEDITOR_H QgsGradientColorRamp gradientRamp() const
Returns the current ramp created by the editor.
Represents a color stop within a QgsGradientColorRamp color ramp.
An interactive editor for previewing a gradient color ramp and modifying the position of color stops ...
QList< QgsGradientStop > QgsGradientStopsList
List of gradient stops.
Gradient color ramp, which smoothly interpolates between two colors and also supports optional extra ...