16#ifndef QGSGRADIENTSTOPEDITOR_H
17#define QGSGRADIENTSTOPEDITOR_H
62 void selectStop(
int index );
70 QSize sizeHint()
const override;
71 void paintEvent( QPaintEvent *event )
override;
83 void setSelectedStopColor(
const QColor &color );
92 void setSelectedStopOffset(
double offset );
99 void setSelectedStopColorSpec( QColor::Spec spec );
115 void setSelectedStopDetails(
const QColor &color,
double offset );
121 void deleteSelectedStop();
129 void setColor1(
const QColor &color );
137 void setColor2(
const QColor &color );
160 void dropEvent( QDropEvent *e )
override;
167 QPixmap transparentBackground();
176 void drawStopMarker( QPainter &painter, QPoint topMiddle,
const QColor &color,
bool selected =
false );
179 double pointToRelativePosition(
int x )
const;
182 int relativePositionToPoint(
double position )
const;
185 bool selectedStopIsMovable()
const;
188 int findClosestStop(
int x,
int threshold = -1 )
const;
196 int mSelectedStop = 0;
199 QPolygonF sOuterTriangle;
202 QPolygonF sInnerTriangle;
204 static constexpr int FRAME_MARGIN_PX = 2;
205 static constexpr int MARKER_WIDTH = 11;
206 static constexpr int MARKER_HEIGHT = 14;
207 static constexpr double MARKER_GAP = 1.5;
208 static constexpr int MARGIN_BOTTOM = MARKER_HEIGHT + 2;
209 static constexpr int MARGIN_X = MARKER_WIDTH / 2;
210 static constexpr int CLICK_THRESHOLD = MARKER_WIDTH / 2 + 3;
AngularDirection
Angular directions.
Gradient color ramp, which smoothly interpolates between two colors and also supports optional extra ...
QgsGradientColorRamp gradientRamp() const
Returns the current ramp created by the editor.
void changed()
Emitted when the gradient ramp is changed by a user.
void mousePressEvent(QMouseEvent *event) override
void mouseDoubleClickEvent(QMouseEvent *event) override
void keyPressEvent(QKeyEvent *event) override
void selectedStopChanged(const QgsGradientStop &stop)
Emitted when the current selected stop changes.
QgsGradientStopEditor(QWidget *parent=nullptr, QgsGradientColorRamp *ramp=nullptr)
Constructor for QgsGradientStopEditor.
void dropEvent(QDropEvent *e) override
void mouseMoveEvent(QMouseEvent *event) override
void setGradientRamp(const QgsGradientColorRamp &ramp)
Sets the current ramp shown in the editor.
void dragEnterEvent(QDragEnterEvent *e) override
Represents a color stop within a QgsGradientColorRamp color ramp.
QList< QgsGradientStop > QgsGradientStopsList
List of gradient stops.